Date and Time Functions

BlitzMax Forums/BlitzMax Programming/Date and Time Functions

Jay Kyburz(Posted 2006) [#1]
Hey Guys,

Has anybody done any work implementing Date and Time functions?

I was thinking of playing around with a scheduling like application but the thought of writing a whole bunch of calendar functions sounds really boring. ie. What day of the week is a particular date, How many days in a month in the correct year etc. yuck.

I guess this stuff is all available at the system level. Perhaps its time i learnt how to call system stuff.


Jay Kyburz(Posted 2006) [#2]
I've been looking at strftime and the way bmax uses it to return the current date and time. Looks like it shouldn't be tooo painful do do what I need. I'll have a look into making a nice Date Type later tonight.

Would still like to hear from any of you who have already done this.


Space_guy(Posted 2006) [#3]
Here is one from the codearchives.

http://www.blitzbasic.com/codearcs/codearcs.php?code=1726


Grey Alien(Posted 2006) [#4]
just a note about smurftra's TDateTime, there is a tiny fix required:

Second = Int(tTime$[7..])

should read:

Second = Int(tTime$[6..])

Smurftra gave me this fix for my framework.


EOF(Posted 2006) [#5]
3 Julian Date functions I posted in the code archives for BlitzMax:
Print JulianDay%("26 MAR 2006")       ' = 2453821
Print JulianDate(2453821)             ' = "26 MAR 2006"
Print DayFromDate$("26 MAR 2006")     ' = "Sunday"

Link:
http://www.blitzmax.com/codearcs/codearcs.php?code=1647


klepto2(Posted 2006) [#6]
Here is another one in module form.

http://www.blitzbasic.com/Community/posts.php?topic=54935