Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Format of GetSysTime()
Format of GetSysTime() [message #9794] Wed, 30 May 2007 21:07 Go to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
I get a timestamp by using this:

String timestamp = GetSysTime().ToString();

The result looks like this:

05/30/2007 20:55:38

How can i format these string that it looks like this:

30.05.2007 20:55:38

?

Michael

[Updated on: Wed, 30 May 2007 22:17]

Report message to a moderator

Re: Format of GetSysTime() [message #9796 is a reply to message #9794] Wed, 30 May 2007 23:18 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
michael wrote on Wed, 30 May 2007 21:07

I get a timestamp by using this:

String timestamp = GetSysTime().ToString();

The result looks like this:

05/30/2007 20:55:38

How can i format these string that it looks like this:

30.05.2007 20:55:38

?

Michael


http://www.ultimatepp.org/forum/index.php?t=msg&th=2229& amp;start=0&

Luigi
Re: Format of GetSysTime() [message #9804 is a reply to message #9794] Thu, 31 May 2007 09:30 Go to previous message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
Thanks Luigi, this works:

SetDateFormat("%3:02d.%2:02d.%1:4d");
Value time = GetSysTime();
String timestamp = time.ToString();

The result looks like this:

31.05.2007 09:28

Michael
Previous Topic: i18n
Next Topic: How to get Directory-Name from String
Goto Forum:
  


Current Time: Sun Apr 28 21:08:05 CEST 2024

Total time taken to generate the page: 0.04307 seconds