示例#1
0
 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);
        }
示例#3
0
 private static SqlExpression DateTimeOffsetToLocalDateTime(SqlExpression dateTimeOffset)
 {
     return(SqlDml.Cast(
                SqlDml.DateTimePlusInterval(
                    DateTimeOffsetToUtcDateTime(dateTimeOffset),
                    SqlDml.DateTimeMinusDateTime(
                        DateTimeOffsetToUtcDateTime(
                            SqlDml.Native("SYSTIMESTAMP")),
                        SqlDml.Native("SYSTIMESTAMP"))),
                SqlType.DateTime));
 }
示例#4
0
 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)));
 }
示例#5
0
 public static SqlExpression DateTimeAddMilliseconds(SqlExpression _this,
                                                     [Type(typeof(double))] SqlExpression value)
 {
     return(SqlDml.DateTimePlusInterval(_this, TimeSpanCompilers.TimeSpanFromMilliseconds(value)));
 }
示例#6
0
 public static SqlExpression DateTimeAdd(SqlExpression _this,
                                         [Type(typeof(TimeSpan))] SqlExpression value)
 {
     return(SqlDml.DateTimePlusInterval(_this, value));
 }
示例#7
0
 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));
 }