Cory Posted June 18, 2009 Report Share Posted June 18, 2009 Supposed I have a date/time var I want to display this time to a user, am I correct that there is no direct way to control the format? IE I will only get the regional system time format. What I am looking for is like the Date/Time command where I can choose to save it as a text var or type it out and specify the format. EG "YYYYMMDD HHNN". The only reasonable workaround is that I could use the Modify Date/Time to extract the components, pad, massage, and reassemble. In this case I'm calculating time estimates and rates so having a value of 10 seconds looking like "12/30/1899 12:00:10 AM" is not useful. This is the tack I'll take for now but I thought I would just check quick to make sure I'm not missing something obvious. Quote Link to comment Share on other sites More sharing options...
terrypin Posted June 19, 2009 Report Share Posted June 19, 2009 Supposed I have a date/time var I want to display this time to a user, am I correct that there is no direct way to control the format? IE I will only get the regional system time format. What I am looking for is like the Date/Time command where I can choose to save it as a text var or type it out and specify the format. EG "YYYYMMDD HHNN". The only reasonable workaround is that I could use the Modify Date/Time to extract the components, pad, massage, and reassemble. In this case I'm calculating time estimates and rates so having a value of 10 seconds looking like "12/30/1899 12:00:10 AM" is not useful. This is the tack I'll take for now but I thought I would just check quick to make sure I'm not missing something obvious. Didn't we discuss something very similar in http://pgmacros.invisionzone.com/index.php?showtopic=3758 ? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted June 19, 2009 Author Report Share Posted June 19, 2009 I do remember a couple of posts were we were on the subject of time but I couldn't remember where or if we specifically spoke of that. I ended up doing the math then converting it back to time and extracting hours, minutes, and seconds. But this gets very long quick. I mean first I do my math, that's a couple of lines, then I convert to time, then I extract HMS as integer, convert to string, pad for those less than 10, replaces spaces with zeros, and finally accumulate into a usable string. It can get close to 20 lines of simple code in no time. And in this case I was tracking 5 different times. It's a little cumbersome. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.