Hi VAer,
>record the date/time and convert it to US Eastern Time, then store it Access table.
According to RLWA32's reply, you can refer to this sample:
public void InsertRecord()
{
string connString = @"...";
using (OleDbConnection connection = new OleDbConnection(connString))
{
//from RLWA32
DateTime dtLocal = DateTime.Now;
TimeZoneInfo tziEST = TimeZoneInfo.FindSystemTimeZoneById("US Eastern Standard Time");
DateTime dtEastern = TimeZoneInfo.ConvertTime(dtLocal, tziEST);
OleDbCommand cmd = new OleDbCommand("INSERT into [Table](Employee, LoginTime) Values(@Name, @Time)");
cmd.Connection = connection;
connection.Open();
cmd.Parameters.Add("@Name", OleDbType.VarChar).Value = "Jennifer";
cmd.Parameters.Add("@Time", OleDbType.VarChar).Value = dtEastern.ToString();
cmd.ExecuteNonQuery();
MessageBox.Show("ok");
}
}
The document about access command: Insert, update, and delete records from a table using Access SQL
Best Regards, Dylan
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our *
*documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**