Jump to content
Macro Express Forums

Date/Time var sanity check


Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...