Now.ToString showing wrong time

Hello, I have a problem with Now.ToString method. In the assign activity I use Now.ToString(“yyyy_MM_dd__HHMM”). In attached screenshot in messagebox it shows the wrong date compared to windows. Is this a bug or am I missing something.

With regards, Marcin

follow below formats

// d: 6/15/2008
// D: Sunday, June 15, 2008
// f: Sunday, June 15, 2008 9:15 PM
// F: Sunday, June 15, 2008 9:15:07 PM
// g: 6/15/2008 9:15 PM
// G: 6/15/2008 9:15:07 PM
// m: June 15
// o: 2008-06-15T21:15:07.0000000
// R: Sun, 15 Jun 2008 21:15:07 GMT
// s: 2008-06-15T21:15:07
// t: 9:15 PM
// T: 9:15:07 PM
// u: 2008-06-15 21:15:07Z
// U: Monday, June 16, 2008 4:15:07 AM
// y: June, 2008
//
// ‘h:mm:ss.ff t’: 9:15:07.00 P
// ‘d MMM yyyy’: 15 Jun 2008
// ‘HH:mm:ss.f’: 21:15:07.0
// ‘dd MMM HH:mm:ss’: 15 Jun 21:15:07
// ‘\Mon\t\h: M’: Month: 6
// ‘HH:mm:ss.ffffzzz’: 21:15:07.0000-07:00

in you’r case Now.ToString(“yyyy_MM_dd__HHmm”) will work

Hi,

What do you mean exactly by wrong date compared to windows? If you want it like Windows ‘06_01_2025_1412’ then you should probably use Now.ToString(“dd_MM_yyyy_HHmm”).

hey @Marcin_Bieniek try with now.tostring("now.ToString(“dd.MM.yyyy hh:mm”)
and if you want to hours as (14) shown in the image just change small (hh) to large (HH) so it work as AM/PM method.

cheers Happy Automation

Thank you it was sure my mistake.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.