Change value of DATE_AND_TIME

I want to change value in DATE_AND_TIME variable. I need to get date of tomorrow. Is there some way how to do it? Because in math it’s now+86400.

Now I know only one way, and it’s terrible - use DT_TO_DTStructure, change it and do chech day, mont, year overflow and use DTStructure_TO_DT to convert it to back DATE_AND_TIME :confused:

Hi,

I haven’t tried, but the mathematical way should work, for example like:

Tomorrow := UDINT_TO_DT(DT_TO_UDINT(Today) + 86400);

… with Tomorrow and Today as variables of type DATE_AND_TIME.

Best regards!

1 Like