FormatDate and file creation

Windows specific forum
purenet
User
User
Posts: 31
Joined: Wed Oct 21, 2009 10:11 am

FormatDate and file creation

Post by purenet »

Hello,

Is this bug or too easy to understand?

Tested with PB 4.41 x86 Windows.

Code
-----
filename.s = FormatDate("%yyyy-%mm-%dd_%hh:%mm", Date()) + ".txt"
CreateFile(0, "c:\" + filename)

Result
------
Filename created is too short: 2010-04-24_22
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: FormatDate and file creation

Post by Kaeru Gaman »

a colon is not a legal char for a filename.
oh... and have a nice day.
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: FormatDate and file creation

Post by Demivec »

':' is not allowed in a filename on the windows OS.

@Edit: too slow. :oops:
purenet
User
User
Posts: 31
Joined: Wed Oct 21, 2009 10:11 am

Re: FormatDate and file creation

Post by purenet »

Of course. Blind me.

Thanks!
Post Reply