©MCS Electronics, 1995-2007
4.With a System Second Number (LONG)
The Return-Value is in the Range of 0 to 36524. 2000-01-01 starts with 0. The Function is valid in the 21th century (from 2000-01-01 to 2099-12-31).
See also
Date and Time Routines , Config Date , Config Clock , SysSec
Example
Enable Interrupts
Config Clock = Soft
Config Date = YMD , Separator =.' ANSI-Format
Dim Strdate As String * 8
Dim Bday Asbyte , Bmonth As Byte , Byear As Byte
Dim Wsysday As Word
Dim Lsyssec As Long
' Example 1 with internal RTC-Clock
_day = 20 : _Month = 11 : _Year = 2 ' Load RTC-Clock for example - testing Wsysday = Sysday()
Print "System Day of " ; Date$ ; " is " ; Wsysday
'System Day of 02.11.20 is 1054
'Example 2 with defined Clock - Bytes (Day / Month / Year) Bday = 24 : Bmonth = 5 : Byear = 8
Wsysday = Sysday(bday)
Print "System Day of Day=" ; Bday ; " Month=" ; Bmonth ; " Year=" ; Byear ; " is " ; Wsysday
'System Day of Day=24 Month=5 Year=8 is 3066
'Example 3 with Date - String
Strdate = "04.10.29"
Wsysday = Sysday(strdate)
Print "System Day of " ; Strdate ; " is " ; Wsysday
'System Day of 04.10.29 is 1763
'Example 4 with System Second Lsyssec = 123456789
Wsysday = Sysday(lsyssec)
Print "System Day of System Second " ; Lsyssec ; " is " ; Wsysday
'System Day of System Second 123456789 is 1428"Now it's " ; Lsystemsecondselapsed ; " seconds later"
SWAP
Action
Exchange two variables of the same type.