Small Change to FormatDate()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
ebs
Enthusiast
Enthusiast
Posts: 558
Joined: Fri Apr 25, 2003 11:08 pm

Small Change to FormatDate()

Post by ebs »

Fred,

Please consider adding tokens to the mask in the FormatDate() function, i.e.:

%m = month in 1 or 2 digits, as necessary
%d = day in 1 or 2 digits, as necessary
%h = hour in 1 or 2 digits, as necessary

Right now, if I want a date formatted like "1/1/2004" instead of "01/01/2004", I have to use something like

Code: Select all

Str(Month(Date())) + "/" + Str(Day(Date())) + "/" + Str(Year(Date()))
and I'd rather write

Code: Select all

FormatDate("%m/%d/%yyyy", Date())
since I'm lazy :wink: !

I guess single digits for minutes and seconds could also be handy, but I use them as two digits most of the time.

Thanks,
Eric
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Re: Small Change to FormatDate()

Post by dontmailme »

Sorry !

Didn't read it right.....

:oops:
Paid up PB User !
Post Reply