Database formatted date w/o module

BlitzMax Forums/BlitzMax Beginners Area/Database formatted date w/o module

ima747(Posted 2010) [#1]
Sorry if this has been asked before but I can't find what I need.

I need to get the current date in a database format i.e. "YYYY:MM:DD" rather than the "DD Month YYYY" that CurrentDate() returns. I don't really want to parse the sections out and make an array to reference the Month names to get the number etc. and I don't really want to use a DateTime module just to get the formatting changed once...


Brucey(Posted 2010) [#2]
This is a modification to the CurrentDate() function.


matibee(Posted 2010) [#3]
Or like this maybe..



A bit crude and not fault tolerant. I don't know if CurrentDate ever returns language specific month abbreviations.


ima747(Posted 2010) [#4]
Thanks for the replies, going with the modification referenced by brucey as I want something less hand written and also it's a more robust and C like solution which helps me port things with less concern of language variants etc.