473,508 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change system date using PHP for Windows and Linux?

9 New Member
how to assign the system date for windows and linux?
Jan 18 '11 #1
4 7381
Niheel
2,456 Recognized Expert Moderator Top Contributor
You can use PHP's exec command combined with the linux command to change the system date. Assuming you're using linux.

exec("date MMDDhhmmYYYY.ss");

MM - month
DD - day
YYYY - year
hh - hour
mm - minutes
ss - seconds

You can then use PHP's date functions like getdate to find out if the time got changed to the value you assigned it.
Jan 18 '11 #2
Moorad
9 New Member
and if am using a WINDOWS OS, then how should i do it ?
Jan 18 '11 #3
Niheel
2,456 Recognized Expert Moderator Top Contributor
Similarly but use the windows command for changing the date and time:

for date:
exec("date M/DD/YYYY");

for time:
exec("time H:MM:SS PM");
Jan 18 '11 #4
Moorad
9 New Member
i dont know what command to use, can you help me out plz ?
Jan 18 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2997
by: inquirydog | last post by:
Hello- I, the inquirydog, would like to solicit suggestions for a new web page I am making: I am creating a simple website that will translate concepts between windows os's, Linux, and the...
1
6874
by: Alexey Golikov | last post by:
Hi, all! How can i change System Date?
4
7166
by: The Spoon | last post by:
I am looking for functions that can be used to automatically update the system date and time on an NT based system, resulting from manually entered date and time values input by an operator via a...
2
4138
by: Richard | last post by:
How can we change/reset the system date. Thanks in advance. RC
10
36773
by: Reshmi Jacob | last post by:
Hi all, Can any one help me with a command by which I can change the system date thru Oracle Regards Reshmi
0
1373
by: =?Utf-8?B?Um9zaGFuIFIuRA==?= | last post by:
Hi All, I need to reboot the system at the beginning of installation, how can I do this, I am using Windows Installer 3.1 version. I am developing a msi which will install applications, drivers...
11
11236
by: ksrashmi | last post by:
Hi , I want to change the system date using java/jsp . i am using linux system . public class LinuxJava { public static void main(String args) { try { String command = "date...
2
2340
by: samvb | last post by:
Hi, I have just finished a program that uses ms access and depends on system date to do certain things. just when i was testing it, a friend suggested that i change system date to see how it reacts....
1
2182
by: kirtiwalia | last post by:
I want to pick system date and display it. Please help me out
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.