see here we store offset. so tell me what is the importance of storing offset data along with date and time ?
what we can do with offset data if we store ?
public void DemoDateTimeOffset()
{
DateTimeOffset offsetValue = new DateTime(2017, 1, 21, 4, 34, 0);
using (SqlConnection cn = new SqlConnection(myConnection))
{
string commandText = @" INSERT INTO DateTimeDemo (DateTimeExample,DateTimeOffsetExample)
VALUES (@DateTimeExample,@DateTimeOffsetExample)";
using (SqlCommand cmd = new SqlCommand(commandText, cn))
{
cmd.Parameters.AddWithValue("@DateTimeExample", DateTime.Now);
cmd.Parameters.AddWithValue("@DateTimeOffsetExample", offsetValue);
cn.Open();
cmd.ExecuteNonQuery();
}
}
}
Nilesh ShahPosted Jan 25, 2017, 3:42 PM
Posted Feb 3, 2017, 4:23 AM
Nilesh ShahPosted Feb 1, 2017, 2:17 PM
Posted Jan 27, 2017, 3:45 AM