03-25-2019 03:06 PM
Hello,
I want to calculate the day of the year out of a given date. NOT out of the current timestamp which is given by the vi "seconds to date/time" in combination with "day/time to seconds". I do not find the way to change the content of a timestamp like "bundle by Name" of a Cluster.
Sounds simple, but i don't want to go the way to calculate the day manually concerning leap years.
Thanks in advance,
Magnus
Solved! Go to Solution.
03-25-2019 03:12 PM - edited 03-25-2019 03:16 PM
Format date/time string with %j as the format code.
Edit:
03-25-2019 03:13 PM
There is a function called "Seconds to Date/Time". It outputs a cluster that has an element for day of the year. Feed whatever timestamp you want into that function. Only if you don't wire up a timestamp does it give you the current timestamp.
03-25-2019 03:17 PM
Ok, thats my problem. How can I generate a "whatever timestamp" out of e.g. a date in string-format?
03-25-2019 03:22 PM
If your date format is always the same, you can use Scan From String to convert the string into individual numeric values and then build the cluster into a date/time record and convert that to a timestamp.
03-25-2019 03:30 PM
Actually the Scan from String will automatically output the timestamp for you, if you have the proper format code.
03-25-2019 03:48 PM
Ok, now I found it. The challenge for me was to find the format string and the related vi.
Thank you very much !!
Magnus