Page 1 of 1

Posted: Mon Sep 16, 2002 8:03 pm
by BackupUser
Restored from previous forum. Originally posted by Berikco.

Hi Fred,

PB does not seem to have Date and Time functions,
Any plans in the futer for this?

Code: Select all

Date()	        ;today date as variable
Time()	        ;time now as variable

Day(z)	        ;day of date z
Month(z)	;month of date z
Year(z) 	;year of date z
WeekDay(z)	;weekday  1=sunday, 2=monday, ..

WeekNo(z)	;weeknumber of date z (1..52)
DayNo(z)        ;daynumber of date z (1..365)

Hour(z)	        ;hour of time z
Minute(z)	;minute of time z
Second(z)	;seconds of time z

DmyHmsToDate(Day, Month, Year, Hour, Minute, Second) ; create date variable from the parts

DmyToDate (Day, Month, Year)    ; create date without time

DateDiff (part, date1, date2)   ; difference in two dates, part is year, month, day, hour, minute, second
I noticed more people with almost te same wishlist viewtopic.php?t=1774">http://forums.pur ... nny.zeb.be

Posted: Mon Sep 16, 2002 9:15 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> PB does not seem to have Date and Time functions,
> Any plans in the futer for this?

Danilo made a nice date/time library from Mr Skunk's original code:

http://home.t-online.de/home/ExpressTrack/SkunkLIB.zip

Also, I made a useful "IsDateValid" procedure here:

viewtopic.php?t=1468

Hopefully these will be okay until PureBasic supports them natively.


PB - Registered PureBasic Coder

Posted: Tue Sep 17, 2002 5:29 pm
by BackupUser
Restored from previous forum. Originally posted by Berikco.
Originally posted by PB
Danilo made a nice date/time library from Mr Skunk's original co
http://home.t-online.de/home/ExpressTrack/SkunkLIB.zip
The date commands in this library are just the same as i gan get with GetLocalTime_ , and it is only windows i see.
My app must be able to run on a linux server later :cry:
The using command in that lib however is very usefull, thanks PB...nice work Danilo.:)
Anybody knows of a DateAdd routine i can use.
I need to calculate the date like this...

Code: Select all

k = PeekL(@buffer$ + 22)  ; k = number of seconds past since 01/01/1970 00:00:00 hour
LogDate = DateAdd("s", k, #01.01.1970#)   ; ad the seconds in k to 1970 and give the date k is representing
The k comes out of a binary log from a RAID controller, it stores the time in a UNIX way...

Regards,

Benny



http://www.benny.zeb.be