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 ShahRank #42 · 34.2K reputationPosted Jan 25, 2017, 10:42 AM EST
Posted Jan 26, 2017, 10:45 PM EST
Nilesh ShahRank #42 · 34.2K reputationPosted Feb 1, 2017, 9:17 AM EST
Posted Feb 2, 2017, 11:23 PM EST