how can i change machain date
-
Hi everybody i want to change machain datetime ,but i dont how thanks for help
MD_NADA
-
Hi everybody i want to change machain datetime ,but i dont how thanks for help
MD_NADA
md_nada wrote:
i want to change machain datetime ,but i dont how
Follow the following steps: 1. Open Notepad 2. Go to Format->Font. Select your favourite font. 3. Look at the time on the Wall Clock at your home/office and write it in on the NotePad. 4. Save the file at C:\ drive with name currenttime.txt. Or did you expect any other answer ;P
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Hi everybody i want to change machain datetime ,but i dont how thanks for help
MD_NADA
see the extreme bottom-right of your computer screen(where the system time is displayed),double click the system time being displayed...and make the changes :)
-
Hi everybody i want to change machain datetime ,but i dont how thanks for help
MD_NADA
Hello you can do this using some Win32 API functions (warning : unmanaged code) please see this : http://bytes.com/forum/thread242372.html[^]
-
md_nada wrote:
i want to change machain datetime ,but i dont how
Follow the following steps: 1. Open Notepad 2. Go to Format->Font. Select your favourite font. 3. Look at the time on the Wall Clock at your home/office and write it in on the NotePad. 4. Save the file at C:\ drive with name currenttime.txt. Or did you expect any other answer ;P
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
hi maybe i was not clear , i mean change machain date programaticlly using C#
MD_NADA
-
Hello you can do this using some Win32 API functions (warning : unmanaged code) please see this : http://bytes.com/forum/thread242372.html[^]
thnx for ur help but i try this code but it dosent work
MD_NADA
-
thnx for ur help but i try this code but it dosent work
MD_NADA
There is a little fix : correct solution
public class Win32
{
private Win32()
{
}\[StructLayout(LayoutKind.Sequential)\] public struct SystemTime { \[MarshalAs(UnmanagedType.U2)\] public short Year; \[MarshalAs(UnmanagedType.U2)\] public short Month; \[MarshalAs(UnmanagedType.U2)\] public short DayOfWeek; \[MarshalAs(UnmanagedType.U2)\] public short Day; \[MarshalAs(UnmanagedType.U2)\] public short Hour; \[MarshalAs(UnmanagedType.U2)\] public short Minute; \[MarshalAs(UnmanagedType.U2)\] public short Second; \[MarshalAs(UnmanagedType.U2)\] public short Milliseconds; } \[DllImport("kernel32.dll")\] public static extern void GetLocalTime( out SystemTime systemTime); \[DllImport("kernel32.dll")\] public static extern void GetSystemTime( out SystemTime systemTime); \[DllImport("kernel32.dll")\] public static extern bool SetSystemTime( ref SystemTime systemTime); \[DllImport("kernel32.dll")\] public static extern bool SetLocalTime( ref SystemTime systemTime); }
....
in you method do this :
Win32.SystemTime sysTime;sysTime.Day = 13; // do all needed modification on date and time... //.... Win32.SetSystemTime(ref sysTime);
Make sure that you got admin rights.