Chris McGrath’s Blog

Just another Developer’s Blog

The worst thing about Batch files

leave a comment »

Date manipulation. So very painful. Not only do you have to do the annoying string manipulation dates are made worse by something else – stupid formats. I’m Australian and I believe in the 2 logical formats for dates day-month-year and year-month-day. It makes sense – smallest unit to largest unit or largest to smallest. But then there’s the American format of month-day-year. Seriously how does this make any sense to anyone? why not we change general numbers to act like this, 842 can become 824 (hundreds-ones-tens).

Anyway, it’s this fact which makes it really annoying. The batch date doesn’t allow you to enter the format you want it outputted as. So if I extract the values to a day, month, year variable then put it on a computer which doesn’t have the same format it doesn’t work.

Luckily we now have Powershell which allows us to manipulate objects instead of strings. Thank you for logic.

Advertisements

Written by Chris McGrath

July 28, 2009 at 12:59 pm

Posted in Blog

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: