ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 12.06.2025
Просмотров: 8155
Скачиваний: 1
© MCS Electronics, 1995-2007
BDayMonthYear |
A Byte – variable, which holds the Day-value followed by Month(Byte) |
and Year (Byte) |
|
StrDate |
A String, which holds a Date-String in the format specified in the |
CONFIG DATE statement |
|
WSysDay |
A Word – variable, which holds the System Day (SysDay) |
LSysSec |
A Long – variable, which holds the System Second (SysSec) |
The Function can be used with five different kind of Input:
1.Without any parameter. The internal Date-values of SOFTCLOCK (_day, _month, _year) are used.
2.With a user defined date array. It must be arranged in same way (Day, Month, Year) as the internal SOFTCLOCK date. The first Byte (Day) is the input by this kind of usage. So the Day of the Week can be calculated of every date.
3.With a Date-String. The date-string must be in the Format specified in the Config Date Statement
4.With a System Day – Number.
5.With a System Second - Number
The Return-Value is in the range of 0 to 6, Monday 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, SYSDAY, SYSSEC
Example
'----------------------------------------------------------------------------- |
|
------------ |
: datetime_test1,bas |
'name |
|
'copyright |
: (c) 1995-2005, MCS Electronics |
'purpose |
: show how to use the Date-Time routines from the |
DateTime.Lib |
: Mega103 |
'micro |
|
'suited for demo |
: no |
'commercial addon needed |
: no |
'----------------------------------------------------------------------------- |
|
------------ |
|
$regfile = "m103def.dat" |
' specify the used |
micro |
' used crystal |
$crystal = 4000000 |
|
frequency |
' use baud rate |
$baud = 19200 |
|
$hwstack = 32 |
' default use 32 |
for the hardware stack |
' default use 10 |
$swstack = 10 |
|
for the SW stack |
' default use 40 |
$framesize = 40 |
|
for the frame space |
|
Const Clockmode = 1 |
|
'use i2c for the clock |
|
#if Clockmode = 1 |
' we use build in |
Config Clock = Soft |
|
page -423- |