03-09-2010 09:01 PM
I converted a time stamp into a time/date string in the format mm/dd/yyyy in order to display it into an array of stings. Now I am pulling the time/date string out of this array and trying to compare it to the current date.
It seems to me that I can't compare dates if they are both strings, because I attempted to convert the current date to a time/date string and compare it the the string that I pulled from the array. This doesn't seem to work correctly.
So, I want to take that cell that I pulled from the array and convert the time/date string back into a time stamp for the comparison. Does anyone know how to do this, I tried the example in help but I can't seem to get that working.
So simply I want to take a time/date string in format mm/dd/yyyy and convert it back to a time stamp in format mm/dd/yyyy
Solved! Go to Solution.
03-09-2010 09:33 PM
here's a quick and simple string to timestamp approach which makes use of scan from string (a truly powerful function) and the date/time to seconds function (an oddly-named function).
Scan from string (strings palette) can be set up to turn the MM, DD, and YYYY into 3 separate numerics. Then we'll feed those into the date/time to seconds (time palette) function. What this function really does is turn a particular cluster into a timestamp. It has an opposite function that turns a timestamp into a cluster, so there's some other things we could do with the pair of them. In any case, the cluster breaks the timestamp up into useful things like day, week, month, year, etc. Create the cluster as a constant from the left-hand node of the time function and then wire it to a bundle-by-name, and bob's yer uncle.
the snippet ate my cluster!
You should wire the error cluster of the scan-from-string because it will throw errors if you pass it a string that is not formatted how it expects.
03-09-2010 10:43 PM - edited 03-09-2010 10:44 PM
A more compact way:
The difference is that the compact way sets the hour to 6 PM. However, since the original string had no time information, it's pretty much arbitrary what you set the time to.
03-09-2010 11:40 PM
smercurio_fc wrote:
The difference is that the compact way sets the hour to 6 PM.
Depending on what time zone you are in. You are in CST, so you are getting -6 relative to GMT midnight. I'm in EST, so I'm seeing 7pm.
03-10-2010 08:37 AM
Ravens Fan wrote:
smercurio_fc wrote:
The difference is that the compact way sets the hour to 6 PM.
Depending on what time zone you are in. You are in CST, so you are getting -6 relative to GMT midnight. I'm in EST, so I'm seeing 7pm.
Don't you know by now that the world revolves around Chicago? It is the center of the universe. Get used to it!
I see that the poster liked the complicated approach as the solution.
03-10-2010 09:11 AM
smercurio_fc wrote:Don't you know by now that the world revolves around Chicago? It is the center of the universe. Get used to it!
I see that the poster liked the complicated approach as the solution.
![]()
Actually, my parent's house is the center of the universe. Where I lived growing up was a easily the most convenient spot for my friends coming from different directions to meet before we would go out and do something together. As a result, I always joked that our house was the "center of the universe."
03-10-2010 09:14 AM
05-04-2010 03:31 PM
05-04-2010 03:43 PM - edited 05-04-2010 03:46 PM
Go to the help for "Format Date/Time String Function" and you'll see a link to "time format codes". It's also linked somewhere on the Scan From String help file, click on "Format string" then look near the bottom for "Format Codes for the Time Format String".
what it is is that %<>T identifies a time code, and the stuff in between the <> is then scanned according to the special codes for times (%m for month, etc.)