Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Datetime and BusinessHours1
Long interval = 24 * 60 * 60 * 1000;
h m s ms
Datetime dt = DateTime.newInstance(2017, 12, 18, 10,0,0);
System.debug('Date :' + dt.format());
Long interval = (24 * 60 * 60 * 1000);
Datetime newdt = BusinessHours.add(bh.Id, dt, interval);
System.debug('After adding 1 day :' + newdt.format());
//OUTPUT
22:12:52:003 USER_DEBUG [3]|DEBUG|Date :12/18/2017 10:00 AM
22:12:52:004 USER_DEBUG [6]|DEBUG|After adding 1 day :12/20/2017 10:00 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment