Extended Time Function Module

BlitzMax Forums/BlitzMax Module Tweaks/Extended Time Function Module

klepto2(Posted 2006) [#1]
I have written a small module that extends the functionality of the standard Getdate() and GetTime() Functions in BMax.

Features:

- Simple Functions to get access to the localtime
with all needed things like day,timezone,day in year and so on .
- Calculating the time and date of any custom date between 1970 and 2037

-Returning the Weekdays and Month in different languages.
Currently supported English, French and German


Link: http://klepto2.kl.funpic.de/DL/timemod.rar

The rar file contains the module and small sample. Better docs will come ;) and of course better samples.

I hope this will be useful for some people.
Some feedback would be nice also.


klepto2(Posted 2006) [#2]
Small UPdate:

http://klepto2.kl.funpic.de/DL/timemod102.rar

added Function GetTimeDifference

This function returns the timedifference of 2 TTime Objects
in Years,months,days,hours,minutes or seconds

added Function CreateTimeFromInt

This Function creates a TTime Object based on an Integer value which you will get if you use the FileTime() command of Bmax

[Edit:]
Link changed, should work now


degac(Posted 2006) [#3]
your link doesn't work...


klepto2(Posted 2006) [#4]
Should work now, thx for notifiing. If the link doesn't work now, then please download manualy from this page :

http://klepto2.kl.funpic.de/DL

And choose the timemod102.rar file.


degac(Posted 2006) [#5]
thank you very useful!
I found a little error in the example: mktime and not mktime_

DefData "Language"
DefData "Italiano"
DefData "Monday","Lunedì"
DefData "Tuesday","Martedì"
DefData "Wendsday","Mercoledì"
DefData "Thursday","Giovedì"
DefData "Friday","Venerdì"
DefData "Saturday","Sabato"
DefData "Sunday","Domenica"
DefData "Mon","Lun"
DefData "Tue","Mar"
DefData "Wed","Mer"
DefData "Thu","Gio"
DefData "Fri","Ven"
DefData "Sat","Sab"
DefData "Sun","Dom"
DefData "January","Gennaio"
DefData "February","Febbraio"
DefData "March","Marzo"
DefData "April","Aprile"
DefData "May","Maggio"
DefData "June","Giugno"
DefData "July","Luglio"
DefData "August","Agosto"
DefData "September","Settembre"
DefData "October","Ottobre"
DefData "November","Novembre"
DefData "December","Dicembre"
DefData "Jan","Gen"
DefData "Feb","Feb"
DefData "Mar","Mar"
DefData "Apr","Apr"
DefData "May","Mag"
DefData "Jun","Giu"
DefData "Jul","Lug"
DefData "Aug","Ago"
DefData "Sep","Set"
DefData "Oct","Ott"
DefData "Nov","Nov"
DefData "Dec","Dic"


These are the translations for italian support, so to contribute..
byez


klepto2(Posted 2006) [#6]
Thx, especially for the Italian Language.
And yes, I have forgotten to delete this line from the sample, it was only for testing the C Function on an early stage.

Nice, that you find it useful :)


degac(Posted 2006) [#7]
in the long (very long...) term I planned to create an Agenda/Personal Information Management program in Bmax, so a function set like your is very important.
byez


Sub_Zero(Posted 2006) [#8]


Translation for norwegian :)


Bremer(Posted 2006) [#9]
DefData "Language"
DefData "Dansk"
DefData "Monday","Mandag"
DefData "Tuesday","Tirsdag"
DefData "Wendsday","Onsdag"
DefData "Thursday","Torsdag"
DefData "Friday","Fredag"
DefData "Saturday","Lørdag"
DefData "Sunday","Søndag"
DefData "Mon","Man"
DefData "Tue","Tir"
DefData "Wed","Ons"
DefData "Thu","Tor"
DefData "Fri","Fre"
DefData "Sat","Lør"
DefData "Sun","Søn"
DefData "January","Januar"
DefData "February","Februar"
DefData "March","Marts"
DefData "April","April"
DefData "May","Maj"
DefData "June","Juni"
DefData "July","Juli"
DefData "August","August"
DefData "September","September"
DefData "October","Oktober"
DefData "November","November"
DefData "December","December"
DefData "Jan","Jan"
DefData "Feb","Feb"
DefData "Mar","Mar"
DefData "Apr","Apr"
DefData "May","Maj"
DefData "Jun","Jun"
DefData "Jul","Jul"
DefData "Aug","Aug"
DefData "Sep","Sep"
DefData "Oct","Okt"
DefData "Nov","Nov"
DefData "Dec","Dec"


Translation for Danish :)


xlsior(Posted 2006) [#10]


And the Dutch translation.


klepto2(Posted 2006) [#11]
thx, for all this languages :)

Here is a new link:
http://klepto2.kl.funpic.de/include.php?path=content/download.php&contentid=1&catid=1&themeid=0

It includes all above languages.


Smurftra(Posted 2006) [#12]
What are the standards getdate() gettime()?

They do not compile and i cant find any info on them...


MrCredo(Posted 2007) [#13]
i searched for filetime-function... but i do not find easy one... kleptos function is very "complex"...

here is my easier code:

Local time:Int = FileTime("c:\test.txt")
Local tm  :Int Ptr = Int Ptr(localtime_(Varptr(time)))

Print "time:" +time
Print "sec:"  +tm[0]
Print "min:"  +tm[1]
Print "hour:" +tm[2]
Print "day:"  +tm[3]
Print "month:"+(tm[4]+1)
Print "year:" +(tm[5]+1900)
Print "wday:" +tm[6]
Print "yday:" +(tm[7]+1)



ziggy(Posted 2007) [#14]
spanish:
DefData "Language"
DefData "Spanish"
DefData "Monday","Lunes"
DefData "Tuesday","Martes"
DefData "Wendsday","Miércoles"
DefData "Thursday","Jueves"
DefData "Friday","Viernes"
DefData "Saturday","Sábado"
DefData "Sunday","Domingo"
DefData "Mon","Lu"
DefData "Tue","Ma"
DefData "Wed","Mi"
DefData "Thu","Ju"
DefData "Fri","Vi"
DefData "Sat","Sa"
DefData "Sun","Do"
DefData "January","Enero"
DefData "February","Febrero"
DefData "March","Marzo"
DefData "April","Abril"
DefData "May","Mayo"
DefData "June","Junio"
DefData "July","Julio"
DefData "August","Agosto"
DefData "September","Septiembre"
DefData "October","Octubre"
DefData "November","Noviembre"
DefData "December","Diciembre"
DefData "Jan","Ene"
DefData "Feb","Feb"
DefData "Mar","Mar"
DefData "Apr","Abr"
DefData "May","May"
DefData "Jun","Jun"
DefData "Jul","Jul"
DefData "Aug","Ago"
DefData "Sep","Sep"
DefData "Oct","Oct"
DefData "Nov","Nov"
DefData "Dec","Dic"



ziggy(Posted 2007) [#15]
Catalan:
DefData "Language"
DefData "Catalan"
DefData "Monday","Dilluns"
DefData "Tuesday","Dimarts"
DefData "Wendsday","Dimecres"
DefData "Thursday","Dijous"
DefData "Friday","Divendres"
DefData "Saturday","Dissabte"
DefData "Sunday","Diumenge"
DefData "Mon","Dl"
DefData "Tue","Dm"
DefData "Wed","Dx"
DefData "Thu","Dj"
DefData "Fri","Dv"
DefData "Sat","Ds"
DefData "Sun","Diu"
DefData "January","Gener"
DefData "February","Febrer"
DefData "March","Març"
DefData "April","Abril"
DefData "May","Maig"
DefData "June","Juny"
DefData "July","Juliol"
DefData "August","Agost"
DefData "September","Setembre"
DefData "October","Octubre"
DefData "November","Novembre"
DefData "December","Desembre"
DefData "Jan","Gen"
DefData "Feb","Feb"
DefData "Mar","Mar"
DefData "Apr","Abr"
DefData "May","Mai"
DefData "Jun","Jun"
DefData "Jul","Jul"
DefData "Aug","Ago"
DefData "Sep","Set"
DefData "Oct","Oct"
DefData "Nov","Nov"
DefData "Dec","Des"