Tags » Datetime

SAMPLE: Jelly-proof date range query

var start = gs.daysAgoStart(daysAgo+6);
var end = gs.daysAgoEnd(daysAgo);
var query = "resolved_atBETWEEN" + start + "@" + end;
 
var gr = new GlideRecord('incident');
gr.addEncodedQuery(query);
gr.query();
while (gr.next()) {

}
Servicenow

Sitecore 8 ServerTimeZone - my dates are all wrong

This issue appeared when I upgraded from Sitecore 7.5 to Sitecore 8. Suddenly my dates on the website were 2 hours behind – on my development server it was one hour behind. 186 more words

Sitecore

Calculate and Display Days, Hours, Minutes

Text Formula field:

TEXT(
FLOOR(SAL_Timestamp__c – CreatedDate)
) & ” Days ” &
TEXT(
ROUND(MOD((SAL_Timestamp__c – CreatedDate)*24,24),0)
) &” Hours ” &
TEXT(
ROUND(MOD((SAL_Timestamp__c – CreatedDate)*1440,60),0) 17 more words

Date/time

Update Error: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.

Problem:

“The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.\r\nThe statement has been terminated.”

Solution:

One of the many reasons is due to insertion of a row with a… 24 more words

.NET

Add Remove Days Code Snippet - jQuery/JavaScript

Date.prototype.removeDays = function (days) {
    var dat = new Date(this.valueOf());
    dat.setDate(dat.getDate() - days);
    return dat;
};

var dateVal = new Date();
dateVal = dateVal.removeDays(2)
Date.prototype.addDays= function (days) {
    var dat = new Date(this.valueOf());
    dat.setDate(dat.getDate() + days);
    return dat;
};

var dateValue = new Date();
dateValue = dateValue.addDays(1)
Javascript

DateTime Format Filter - AngularJS

.filter('dateFilter', [
           '$filter', function ($filter) {
               return function (input, format) {
                   return input ? $filter('date')((new Date(input)), format) : null;
               };
           }
       ])
Javascript

CRM 2015 Update 1: Store date and time values with or without time zone information

Until the previous release of CRM, all date and time values in CRM were time zone aware, including those with the Date Only format.

Use the new DateTimeAttributeMetadata.DateTimeBehavior property to store date and time values… 310 more words

Microsoft Dynamics CRM