here is my codes for changing my system time :
(i want to use them in my vps - windows server 2008 - r2)
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEMTIME
{
public short wYear;
public short wMonth;
public short wDayOfWeek;
public short wDay;
public short wHour;
public short wMinute;
public short wSecond;
public short wMilliseconds;
}
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool SetSystemTime(ref SYSTEMTIME theDateTime);
private void button1_Click(object sender, EventArgs e)
{
DateTime now = DateTime.Now;
SYSTEMTIME st = new SYSTEMTIME();
st.wYear = short.Parse(now.Year.ToString()); // must be short
st.wMonth = short.Parse(now.Month.ToString());
st.wDay = short.Parse(now.Day.ToString());
st.wDayOfWeek = short.Parse(((int)now.DayOfWeek).ToString());
st.wHour = 5;
st.wMinute = 20;
st.wSecond = 30;
st.wMilliseconds = 0;
bool ret_val = SetSystemTime(ref st); // invoke this method.
}
but my ststem time after these codes is : 6 : 20 AM.
what is the problem and how can i fix it?
EDIT :
MY UTC IS : (UTC) Dublin, Edinburgh, Lisbon, London