View previous topic :: View next topic |
Author |
Message |
abifar1
Joined: 08 Aug 2005 Posts: 66 Location: Austria
|
Posted: Wed Aug 02, 2006 8:31 pm Post subject: eurotimedate Query |
|
|
Hi
I need a tip about how using "eurotimedate.lib" because I use RTC ds1307 and this code for date format same as "02/27/06" :
$lib "ds1307.lib"
$lib "eurotimedate.lib"
Config Clock = User
Config Date = Mdy , Separator = /
but problem is when I change Conifg to :
Config Date = dmy , Separator = .
it does not effect and date format is same as before "02/27/06" !!
what I am doing wrong ? can anybody tell me ? |
|
Back to top |
|
|
DToolan
Joined: 14 Aug 2004 Posts: 1384 Location: Dallas / Fort Worth, Texas (USA)
|
Posted: Wed Aug 02, 2006 10:02 pm Post subject: |
|
|
You are mixing too many statements that are competing for control and the ds1307.lib is winning. If you want to use the ds1307.lib, it is preset for MM/DD/YY display.
If you want to use the eurotimedate.lib, it is preset for DD-MM-YY (no periods as seperators).
Your "CONFIG DATE =" statements seem to have no effect if you use any $lib designed to do Date$ control. |
|
Back to top |
|
|
ATIU
Joined: 15 Oct 2004 Posts: 534
|
Posted: Wed Aug 02, 2006 10:52 pm Post subject: |
|
|
You can probably combine both libraries, cut and paste, and modify the separator as well. Open the library and it should be pretty staight forward since its very well commented/documented. |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Thu Aug 03, 2006 1:42 am Post subject: |
|
|
this work ok to
Code: |
$regfile = "m32def.dat"
$crystal = 8000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40
$lib "ds1307rtc.lib"
'$lib "eurotimedate.lib"
Dim A As Byte
Enable Interrupts
'[now init the clock]
Config Date = Dmy , Separator = . ' ANSI-Format
Config Clock = Soft 'this is how simple it is
'The format is DD/MM/YY
Date$ = "03.08.06"
'Time$ = "02:20:00"
'test on date Day step up every sec
A = 1
Do
_day = A
Print Date$ ; " " ; Time$ 'show the date and time
Wait 1
A = A + 1
If A > 31 Then A = 1
Loop
End |
01.08.06 02:20:00
02.08.06 02:20:30
Code: | $regfile = "m32def.dat"
$crystal = 8000000
$baud = 19200
$hwstack = 32
$swstack = 10
$framesize = 40
$lib "ds1307rtc.lib"
'$lib "eurotimedate.lib"
Dim A As Byte
Enable Interrupts
'[now init the clock]
Config Date = Mdy , Separator = . ' ANSI-Format
Config Clock = Soft 'this is how simple it is
'The format is MM/DD/YY
Date$ = "03.08.06"
'Time$ = "02:20:00"
'test on date Day step up every sec
A = 1
Do
_day = A
Print Date$ ; " " ; Time$ 'show the date and time
Wait 1
A = A + 1
If A > 31 Then A = 1
Loop
End |
03.01.06 02:21:11
03.02.06 02:21:12 _________________ / Kim |
|
Back to top |
|
|
abifar1
Joined: 08 Aug 2005 Posts: 66 Location: Austria
|
Posted: Thu Aug 03, 2006 12:02 pm Post subject: |
|
|
DToolan and ATIU Thank you very much I think your right I should change in DS1307.lib but it is a pittule difficult for me because I dont know too much Assbmly . I am trying if it works I tell you .
but I think easiest way for me is just change string or DATE by a Sub in Bascom .
KIMMI I dont get what are codes you are writnig seems you did not get the query !! |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Thu Aug 03, 2006 2:51 pm Post subject: |
|
|
ohhh sorry
Do you have Phil´s ds1307rtc.lib ?
'get date & time from the DS1307 & convert it to binary & stick it in the
'global variables _sec, _min, _hour, _day, _month. _year
'This routine is called automaticly whenever the "Date$" or "Time$" is read. (I guess, because it is not documented)
'This routine must be called maunally, just prior to, whenever a other time & date routines are used,
'eg "SysSecElapsed" & "SysSec()" _________________ / Kim |
|
Back to top |
|
|
|