473,466 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to get the exact time of the user's country when he commment

49 New Member
I want to get the exact time of user when he did comment. As the user belongs to different country so I want to get the exact time of his country just like in discussion form in PHP.
May 15 '10 #1
3 1967
Atli
5,058 Recognized Expert Expert
Hey.

The time function gives you the current time as a Unix timestamp, which you can format into readable dates using the date function. - It is generally best to store dates as timestamps, or at least using the GMT timezone, so you can more easily manipulate what timezone is to be used to display it.

Getting the client's timezone is trickier, though. If your users register for the site, then you would be best off asking them to choose the timezone they want used during the registration process. If not, you will have to resort to something like geo-location via the IP address.
May 16 '10 #2
dinesh1985singh
49 New Member
@Atli
Thank you Atli,

I am exactly interested in getting geo-location or time zone via users ip.So please let me know this.

thanks for your any kind of suggestion
Thank you
May 16 '10 #3
phobia
5 New Member
There are multiple providers for that kind of data, e.g. ip2location.com and maxmind.com.

Since you only need to know the country, the free GeoLite Country db from Maxmind should do. Have a look here: http://www.maxmind.com/app/geolitecountry
May 16 '10 #4

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

Similar topics

5
by: feng | last post by:
I want to use onunload to capture user's action when he clicks on the "x" button to close the browser. Here is how I do this: <SCRIPT FOR="window" EVENT="onunload"> myScript(); </SCRIPT> ...
0
by: feng | last post by:
I want to use onunload to capture user's action when he clicks on the "x" button, the close window button on the upper-right corner of the brower window, to close the browser. Here is how I...
3
by: Asad | last post by:
Hi, I was wondering how I can find out the time user takes on an aspx page before hitting a submit button. Since there is that whole server-side vs. client-side issue, I was thinking I can store...
3
by: Moojjoo | last post by:
I created an user control (.ascx file) with a DropDownList (DDL) with the following code behide: public string Selected_dept_value() { string dept_value = dept_dropdown.SelectedValue; return...
1
by: Asad | last post by:
Hi, I was wondering how I can find out the time user takes on an aspx page before hitting a submit button. Since there is that whole server-side vs. client-side issue, I was thinking I can store...
2
by: Salim Afsar | last post by:
Hi, My web server is not my country, so server's time and my country time is different. So code runs on server, for example when I run DateTime.Now() function it returns server time but I want...
3
by: dw | last post by:
stilHello... Is there a way to detect a person's time zone and/or country when they browse to a site? I want to dynamically display controls and labels based on the user's time zone or...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
1
by: aramakri | last post by:
I just want to know when a particular function is called.Can anybody help me in getting this time in seconds.
14
by: happyse27 | last post by:
Hi all, I did the null string comparison for below... But could not work as i keyed some value into the $company field but it did not print out okok, but not ok. I used if ($company != '')...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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
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
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 ...

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.