Bizarre date handling from a user-defined 'tool'

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
iannorthwood
Posts: 7
Joined: Sat May 29, 2004 9:06 am

Bizarre date handling from a user-defined 'tool'

Post by iannorthwood »

I have a bunch of scripts which I run from TP tools I created. One of these scripts creates an MD5 hash against a file using, amongst other things, a date string. The string is formatted VB Script using long date:

FormatDateTime([thefileobject].DateCreated, 4)

When run from a command prompt, I get the date I want, '25 October 2005'. However, when the script is run from the TP tool, I get short date, '25/10/2005'

This has to be a bug, right? If not, is there a work-around? And please don't suggest using some string other than the date...
bveldkamp

Post by bveldkamp »

There must be something else going wrong, because "4" means "Short Time", if you need the short date, use FormatDateTime([thefileobject].DateCreated, 2).
http://msdn.microsoft.com/library/defau ... d75725.asp

BTW I can't see a difference running from a DOS prompt or from Textpad, both display "1/16/2006"
Post Reply