473,473 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Server GMT time problem

51 New Member
I've a field in a table that datatype's type datetime. Here i want to get current server GMT time before insert into db. Any idea why this code always give me result in am although the present time is pm?

Sample result: 18/09/2007 01:29:04 am

here the php code;

[PHP]$time = gmdate('Y-m-d h:i:s', mktime(gmdate('GMT') + 8));[/PHP]
Sep 18 '07 #1
5 3539
ak1dnar
1,584 Recognized Expert Top Contributor
Do not post Questions in the Article Sections. [Plzzzzzzzzzzz]
Sep 18 '07 #2
ak1dnar
1,584 Recognized Expert Top Contributor
I've a field in a table that datatype's type datetime. Here i want to get current server GMT time before insert into db. Any idea why this code always give me result in am although the present time is pm?

Sample result: 18/09/2007 01:29:04 am

here the php code;

[PHP]$time = gmdate('Y-m-d h:i:s', mktime(gmdate('GMT') + 8));[/PHP]
Are you using your local, machine as your server? or where is your server located? You know what is gmdate(), right?
Sep 18 '07 #3
Fareast Adam
51 New Member
Ya i used localhost as my server. Sorry for any mistaken!
Sep 18 '07 #4
Fareast Adam
51 New Member
I want to get present Malaysia GMT time (GMT + 08:00) within localhost. But i got the unexpected result, where all the result display am althought currently is pm in Malaysia when i retrieve it from database. Am i wrong on way?
Sep 18 '07 #5
kovik
1,044 Recognized Expert Top Contributor
I'm not to sure what you are doing with mktime(), gmdate(), or the +8, but I'm fairly sure you didn't read the documentation very well. Don't worry... I'm feeling nice today. Try this (not tested):

[php]gmdate('Y-m-d H:i:s', strtotime('+8 hours'));[/php]

Just so you know, strtotime() is awesome. :P
Sep 19 '07 #6

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

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
5
by: Phil Grimpo | last post by:
I have a very odd situation here. I have an administration page, where based on a users permissions, a recordset is called from the SQL server which has a list of paths to "Module Menus". Each of...
4
by: Phil Grimpo | last post by:
I had previously explained this problem in a different thread, but now that I have an IISState log, I figured I'd re-start the thred. My situation and the log are following... I have a very odd...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
10
by: gary0gilbert | last post by:
An unusual spin to this recurring disk or network error in a Terminal Server environment. Access 2000, Terminal Server 2000, file server is windows 2000. All users have a separate copy of the...
1
by: Jean-Paul Calderone | last post by:
On Fri, 21 Nov 2008 00:20:49 -0200, Gabriel Genellina <gagsl-py2@yahoo.com.arwrote: If you want to try this program out on POSIX, make sure you change the time.clock() calls to time.time() calls...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.