Display tag value in MM/dd/yyyy format
Hi
I have a tag with Date/Time information, I am logging it as I8 type. I am getting this information from Logix5000 using GSV instruction wallclock -> currentvalue. (Long INT)
Is it possible to display tag value (Not time stamp) in MM/dd/yyyy format?
11 replies
-
Hi afzaal. ahmed ,
We may be able to transform it through some scripting, but we would need to know what format the I8 is represented in. Is it an epoch time such as EpochSeconds or EpochMilliseconds?
-
Hi Steve Mason
Its EpochMicroseconds
-
Steve Mason
You want example as PLC logic(logix5000 file) or screen shot?
-
Steve Mason
Here 1649635200000000 = 04/11/2022 April 11,2022
and 1649721600000000 = 04/12/2022
I am OK with both formats
MM/dd/yyyy 04/11/2022
and dd-MMM-yyyy 11-Apr-2022
I know how to extract # of days from epochmicroseconds, but I don't know to represent date in above format.
Because I am not concerned with time so daylight saving details do not matter.
In attachment I added Logix5000 Add on Instruction that converts epochmicroseconds to equivalent date. If you cannot open logic I will send screen shots.
-
Apparently deleting following line fixed the issue
.ToLocalTime()
-
Thanks for your help Steve Mason