0

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?

11replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • 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?

    Like 1
  • Hi Steve Mason

    Its EpochMicroseconds 

    Like
    • afzaal. ahmed 

      Could you send us an example of one of the values in the epoch format and what you expect that to be transformed into? It would be helpful if you had an example before and after daylight savings time.

      Like 1
  • Steve Mason

    You want example as PLC logic(logix5000 file) or screen shot?

    Like
    • afzaal. ahmed 

      A screenshot would be fine. We just want to make sure what the tag value looks like and what you would want it to look like after the transformation.

      Like 1
  •  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()
    Like
    • afzaal. ahmed 

      Glad you could get it to work!

      Like 1
  • Thanks for your help Steve Mason

    Like
print this pagePrint this page
Like Follow
  • 1 yr agoLast active
  • 11Replies
  • 79Views
  • 2 Following