WagoAppTime How to get time and day word format

Hello. I’m using wagoapptime library.
How can I get data separately in word type as day, month, year, hour and minute?

Use function FuConvertStampToLocalTimeComponants.

You get a structure with “exploded” time variable.

2 Likes

Thank you very much for your help.

Hi, is there any way to see and example on ST of how to use functions in order to get the current Hour.

I’m using:

localtime:= wagoapptime.FuGetLocalDateAndTime(); // it works good, i can see date and time.

but for getting the hour I’m using:

localtime2 := wagoapptime.Fuhour(xxxxxx) but i can’t find the way to declare the arguments of this function correctly.

Or, if you have an easier way to get the current hour, it would be great.

Hopefully this example will help your need.

RealTimeClockExample_fw30p2_cs21p5.project (324.6 KB)

1 Like

David:

Yes, it helped.

Thank you so much!!

For future readers:
In WagoAppTime you can also find function FuGetLocalTimeComponents
So you don’t have to convert your time

Btw, if you want to show time for example in the visualization you can use WagoAppString. TimeComponents_To_String

Example:

VAR
	typLocalTimeComponents: WagoAppTime.WagoTypes.typWagoTimeComponents;
	sTimeStringExample: STRING;
END_VAR

typLocalTimeComponents := WagoAppTime.FuGetLocalTimeComponents();
sTimeStringExample := WagoAppString.TimeComponents_To_String(typLocalTimeComponents,'Its %h:%m, %D.%M.%Y, %W');

image

1 Like