private static SqlExpression DateTimeOffsetToLocalDateTime(SqlExpression dateTimeOffset) { return(SqlDml.Cast( SqlDml.DateTimePlusInterval( Switchoffset(dateTimeOffset, "+00:00"), SqlDml.DateTimeMinusDateTime(SqlDml.Native("getdate()"), SqlDml.Native("getutcdate()"))), SqlType.DateTime)); }
public virtual void DateTimeAddIntervalTest() { var select = SqlDml.Select(); select.Columns.Add(SqlDml.DateTimePlusInterval(new DateTime(2001, 1, 1, 1, 1, 1, 1), new TimeSpan(10, 10, 10, 10, 10))); select.Columns.Add(new DateTime(2001, 1, 11, 11, 11, 11, 11)); CompareColumnEquality(select); }
private static SqlExpression DateTimeOffsetToLocalDateTime(SqlExpression dateTimeOffset) { return(SqlDml.Cast( SqlDml.DateTimePlusInterval( DateTimeOffsetToUtcDateTime(dateTimeOffset), SqlDml.DateTimeMinusDateTime( DateTimeOffsetToUtcDateTime( SqlDml.Native("SYSTIMESTAMP")), SqlDml.Native("SYSTIMESTAMP"))), SqlType.DateTime)); }
private static SqlExpression DateTimeConstruct( SqlExpression year, SqlExpression month, SqlExpression day, SqlExpression hour, SqlExpression minute, SqlExpression second, SqlExpression millisecond) { return(SqlDml.DateTimePlusInterval( SqlDml.DateTimeConstruct(year, month, day), TimeSpanCompilers.GenericIntervalConstruct(0, hour, minute, second, millisecond))); }
public static SqlExpression DateTimeAddMilliseconds(SqlExpression _this, [Type(typeof(double))] SqlExpression value) { return(SqlDml.DateTimePlusInterval(_this, TimeSpanCompilers.TimeSpanFromMilliseconds(value))); }
public static SqlExpression DateTimeAdd(SqlExpression _this, [Type(typeof(TimeSpan))] SqlExpression value) { return(SqlDml.DateTimePlusInterval(_this, value)); }
public static SqlExpression DateTimeOperatorAddition( [Type(typeof(DateTime))] SqlExpression d, [Type(typeof(TimeSpan))] SqlExpression t) { return(SqlDml.DateTimePlusInterval(d, t)); }
public virtual void DateTimeAddIntervalTest() { CheckEquality( SqlDml.DateTimePlusInterval(DefaultDateTime, DefaultTimeSpan), DefaultDateTime.Add(DefaultTimeSpan)); }