Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: DateDiff second interval with large date differences
Topic Summary:
Created On: 03/28/2018 09:56 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 03/28/2018 09:56 AM
User is offline View Users Profile Print this message

Author Icon
Apprentice (20-49)

Posts: 42
Joined: 11/14/2014

I am trying to calculate the number of seconds since 1/1/1601 to write an LDAP query that will find old computer objects. However, DateDiff will not return the correct number of seconds. It works fine if I use a larger interval (like years).

<AMSHOWDIALOG>Num seconds since 1601: %DateDiff("s", #1/1/1601#, #3/28/2018#)%
Add num seconds to 1601: %DateAdd("s", DateDiff("s", #1/1/1601#, #3/28/2018#), #1/1/1601#)%</AMSHOWDIALOG>

The number that I should get back is 13166668800. But I'm getting back 281594113. Maybe DateDiff is running into a 32-bit integer limitation?

I'll work around this calculation with PowerShell.

 Category Survey
 03/29/2018 09:23 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile

Posts: 5454
Joined: 05/15/2007

Hi David,

This has been reproduced in internally and documented for correction:

24017 - DATEDIFF() FUNCTION: datadiff function returns different (wrong) value compared to vb

 Category Survey


Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 933 guests browsing this forum, which makes a total of 933 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog