Megvan!
Date(l2)-> nem 12 hanem L2!
A kb. programlényeg (mondjuk most izNet modullal futom):
Kód: Egész kijelölése
Dim Clock(4) As Byte
Dim L1 As Long At Clock Overlay
Dim L2 As Long
.
.
.
'Socket 0 RX Received Size
Call Wiz5100_readvalue(w5100_s0_rx_rsr0)
Sizeh = Value
Call Wiz5100_readvalue(w5100_s0_rx_rsr1)
Sizel = Value
Print "Received bytes " ; Size
Decr Size
Count = 1
Temp = Gs0_rx_base + Size
For X = Gs0_rx_base To Temp
Call Wiz5100_readvalue(x)
Print Hex(x) ; " " ; Hex(value) ; " " ; Value;
If X > &H6007 Then
Print " <<"
Clock(count) = Value
Incr Count
Else
Print
End If
Next X
Print
Swap Clock(1) , Clock(4)
Swap Clock(3) , Clock(2)
L2 = L1 + 1139293696
L2 = L2 + 7200
Cls
Home
Lcd "Date: " ; Date(l2)
Print "Date: " ; Date(l2)
Lowerline
Lcd "Time: " ; Time(l2)
Print "Time: " ; Time(l2)
End
A lényeg, hogy a visszakapott időpecsétet tartalmazza az L2. Ebből az év-hónap-nap kinyerése:
Kód: Egész kijelölése
A = Date(l2)
Print "nap:" ; Mid(a , 1 , 2) ; " hónap:" ; Mid(a , 4 , 2) ; " év:" ; Mid(a , 7 , 2)
Elvileg a DATEsúgó ír 3 byte-t, ami a év-hónap-nap összefüggést adja. Ugyanígy a TIME is tud ilyet. Ezt 3 perc után feladtam:) Végülis stringben is visszajött... Onnan egy Val() és meg is van byteként...
A belső súgó a datetime.lib-ben:
; Functions for Date and Time Computing
; All Functions work with Time and Date Values defined by the _SoftClock Routine
; that;s _sec, _min, _hour, _day, _month, _year (All Bytes)
; The Functions based on 1.1.2000 and valid from 2000 to 2099
; Content of Library:
; - _DayOfWeek: Daynumber of Weekday 0 to 6 for Monday to Sunday
; - _DayOfYear: Daynumber of Year, first January start with 1 to 365(366)
; - _SecOfDay: Count of Seconds till Midnight, 0 to 86399
; - _SecElapsed: Seconds since Time-stamp (last SecOfDay)
; - _SysDay: System Day-Number = Days since 2000-01-01: Starts with 1
; - _SysSec: System Seconds = Seconds since 2000-01-01 00:00:00
; - _SysSecElapsed: Seconds since last time-stamp (last SysSec)
;
; During reading the Date/Time information Interupt is locked, so Softclock can not
; changes values during reading
;
;
; Date and Time - Values can handled in 3 ways
; 1. Discrete values for sec, min, hour; day, month, day as used by internal SOFTCLOCK
; 2. Date and Time-Strings (See Date$, Time$)
; 3. Numeric values for calculating with date and time
; - time = SecOfDay
; - date = DayOfYear, SysDay
; - time & date = SysSec
;
; in this library there are converting routines between this 3 Date and time - formats
Első olvasatban a részeredményeket a belső r1...32 részeken tárolja és TEXT alapon kapsz eredményt.