Jump to content

how do I change the time/date format with a batch file?

Vampire2.0

Hi,

 

i'm trying to change the time format from:

 

00:00:00,00 to 00-00-00-00

01/01/2001 to 01-01-2001

 

With a batch file.

 

I know the visual way but can't find a command to do it.

 

Can anyone help me?


- teamspeak.ltt-unofficial.com

- teamspeak.ltt-unofficial.net

- teamschnitzel.ltt-unofficial.com

- teamschnitzel.ltt-unofficial.net



cpu: Intel sandybridge-E 3930k @ 4.2Ghz

cooler: corsair h100 @ full speed push-pull

motherboard: Asus Rampage IV Extreme

gpu: 2x EVGA GTX660's & 1x EVGA GTX980

ssd: 2x samsung 256GB 840 pro raid 0

ssd: 1x samsung 1TB 840 evo

hdd: WD green 3TB

hdd: Seagate Barracuda 1TB (st1000dm003)

hdd: Seagate Barracuda 1TB (st31000520as)

psu: corsair ax1200i

ram: 8x 4GB corsair platinum @1866mhz

case: coolermaster cosmos II

age: Do the math (summer 2012)

monitors Main: 8x LG 22EA53 1080p 60hz

monitor Extra: 1xiiyama prolite G2773Hs 1080p 120hz 27"

os: windows 7 pro (64-bit)

keyboard: logitech g19

mouse: corsair m60

 


Lenovo T550

 


RaspBerry pi webserver:

Status: Offline.

 

Nas:

StatusOffline.

 


PC straight to the modem/router/switch/DHCP-Server/... with a 20cm (+-8inch) cat6a patch cable because same price as cat5.

ISP: Telenet (belgium)

Speed: 60Down-4Up (+- 45€/month)

ping to there servers: +-8ms

ping to other Belgians: +-12ms

 

 



- wheels for cosmos II


 

Link to comment
Share on other sites

Link to post
Share on other sites

It's not entirely clear what you're trying to do. It looks like you are trying to edit timestamps within a file, if this is the case how about using a regular expressions to change the date and time values. You can do this using a text editor like notepad++, assuming you're on Windows.

 

Using the find and replace function in a text editor the regular expressions would look something like this:

 

For the time:

    Find: (\d\d):(\d\d):(\d\d),(\d\d)

    Replace with:\1-\2-\3-\4

 

For the date:

    Find: (\d\d)/(\d\d)/(\d\d\d\d)

    Replace with: \1-\2-\3

Link to comment
Share on other sites

Link to post
Share on other sites

It's not entirely clear what you're trying to do. It looks like you are trying to edit timestamps within a file, if this is the case how about using a regular expressions to change the date and time values. You can do this using a text editor like notepad++, assuming you're on Windows.

 

Using the find and replace function in a text editor the regular expressions would look something like this:

 

For the time:

    Find: (\d\d) :(\d\d) :(\d\d),(\d\d)

    Replace with:\1-\2-\3-\4

 

For the date:

    Find: (\d\d)/(\d\d)/(\d\d\d\d)

    Replace with: \1-\2-\3

 

it doesn't seems to work:

 

02a33dd23e.png

 

121d4daab5.png

 

the thing i would like to change with a Batch:

 

1. Control Panel\Clock, Language, and Region

2. Region and Language

3. Formats

4. additional settings...

 

i would like to change those symbols with a batch file.


- teamspeak.ltt-unofficial.com

- teamspeak.ltt-unofficial.net

- teamschnitzel.ltt-unofficial.com

- teamschnitzel.ltt-unofficial.net



cpu: Intel sandybridge-E 3930k @ 4.2Ghz

cooler: corsair h100 @ full speed push-pull

motherboard: Asus Rampage IV Extreme

gpu: 2x EVGA GTX660's & 1x EVGA GTX980

ssd: 2x samsung 256GB 840 pro raid 0

ssd: 1x samsung 1TB 840 evo

hdd: WD green 3TB

hdd: Seagate Barracuda 1TB (st1000dm003)

hdd: Seagate Barracuda 1TB (st31000520as)

psu: corsair ax1200i

ram: 8x 4GB corsair platinum @1866mhz

case: coolermaster cosmos II

age: Do the math (summer 2012)

monitors Main: 8x LG 22EA53 1080p 60hz

monitor Extra: 1xiiyama prolite G2773Hs 1080p 120hz 27"

os: windows 7 pro (64-bit)

keyboard: logitech g19

mouse: corsair m60

 


Lenovo T550

 


RaspBerry pi webserver:

Status: Offline.

 

Nas:

StatusOffline.

 


PC straight to the modem/router/switch/DHCP-Server/... with a 20cm (+-8inch) cat6a patch cable because same price as cat5.

ISP: Telenet (belgium)

Speed: 60Down-4Up (+- 45€/month)

ping to there servers: +-8ms

ping to other Belgians: +-12ms

 

 



- wheels for cosmos II


 

Link to comment
Share on other sites

Link to post
Share on other sites

it doesn't seems to work:

 

what @random1234 was saying was to use notepad++ to do the find and replace for a text file...which would work for replacing the date time in a text file (which is what your first post implied)

 

After reading your second post though, I can say this probably would have been posted in the OS portion, as this is pertaining to changing settings in windows.

 

I can't think of a windows program command that does that...not sure one exists.  You would need to effectively change the region settings within windows (also it could depend on which windows os you are running)....the only two workarounds I could find is a registry edit...which I would not recommend at all, to dangerous....and creating a specially crafted xml which will replace that settings using the control program (maybe someone could help you out there, but it could be dangerous...not sure though)

 

*edit:  Sorry for using the control portion, here is the link to MSDN if someone else can look over it to come up with an xml solution (you would need one to create the format change and one for the original settings) http://msdn.microsoft.com/en-us/goglobal/bb964650

0b10111010 10101101 11110000 00001101

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×