The CreatorCon Call for Content is officially open! Get started here.

Query on getDayOfMonth() method

tj2
Kilo Contributor

Hi,

When we run the following code in one of our server side scripts we get the output as 1

var gdt = new GlideDateTime("2012-8-02 06:00:00");
gs.log(gdt.getDayOfMonth());

Whereas when we run the following code in one of our server side scripts we get the output as 2
var gdt = new GlideDateTime("2012-8-02 07:00:00");
gs.log(gdt.getDayOfMonth());

Could you advice why this difference in the Day of month?

Thanks

7 REPLIES 7

jason_petty
Tera Expert

I ran both of these snippets of code on my system and they both returned 2.


DubeyN
Mega Expert

Hey Jason,

I am also getting same output as tj getting. 1,2 is the output for me.

ND


jason_petty
Tera Expert

On what version/build of ServiceNow is your instance?


tj2
Kilo Contributor

Build on our SN instance - glide-october2011-10-28-2011__patch2-hotfix6-02-28-2012
Version 3