Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Date math problem

George P
Tera Guru

Hello,

I am attempting to use GlideDate to calculate the difference between today and a saved date, but I keep getting the time included with the GlideDate object (even though everything says that doesn't happen.

 

I ran this script as a test:

 
var today = new GlideDate();
today.getByFormat('yyyy-mm-dd');
gs.print('Get by format numeric value: ' + today.getNumericValue());

var todayManual = new GlideDate();
todayManual.setDisplayValue('2025-10-07');
gs.print('Set by display value numeric value: ' + todayManual.getNumericValue());

The result is 2 different numbers.

*** Script: Get by format numeric value: 1759851173663
*** Script: Set by display value numeric value: 1759795200000

I need to get the second value for today.

1 ACCEPTED SOLUTION

Bhuvan
Giga Patron

@George P 

 

Try below

 

 

Bhuvan_1-1759852251609.png

 

Bhuvan_2-1759852269247.png

If this helped to answer your query, please mark it helpful & accept the solution. 

 

Thanks,

Bhuvan

View solution in original post

1 REPLY 1

Bhuvan
Giga Patron

@George P 

 

Try below

 

 

Bhuvan_1-1759852251609.png

 

Bhuvan_2-1759852269247.png

If this helped to answer your query, please mark it helpful & accept the solution. 

 

Thanks,

Bhuvan