How to get current datetime not machine date [Resolved]

Posted by Shoyebaziz123 under ASP.NET on 10/29/2013 | Points: 10 | Views : 1126 | Status : [Member] | Replies : 8
Hi All,

I need date from internet not from machine date,
how can i get date ( for eg today) if i change my machine date but it should display current date ..in sql server or asp.net




Responses

Posted by: Bandi on: 10/29/2013 [Member] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
Refer this link for getting date time from internet
http://stackoverflow.com/questions/6676191/how-can-get-datetime-from-internet-external-resource-not-from-server

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/29/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer e following link
http://www.blackwasp.co.uk/SQLGetDate.aspx


GETDATE() or CURRENT_TIMESTAMP: Return date & time from the server but not the local machine....

--Sample

-- Select the current local time
SELECT CURRENT_TIMESTAMP

-- Print the current local time
DECLARE @CurrentTime DATETIME
SET @CurrentTime = CURRENT_TIMESTAMP
PRINT @CurrentTime


SYSDATETIME():
Returns a datetime2(7) value that contains the date and time of the computer on which the instance of SQL Server is running.

Reference:
http://wiki.evident.nl/(X(1)S(s3dqsumqsdu2yujun04pptef))/Default.aspx?Page=SYSDATETIME%20versus%20GETDATE&AspxAutoDetectCookieSupport=1

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shoyebaziz123 on: 10/29/2013 [Member] Starter | Points: 25

Up
0
Down
but i dont want system date , if some one changes computer/server date then...

i need date must be current universal date.

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shoyebaziz123 on: 10/29/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks a lot dear

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/29/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
You are welcome :)

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 10/30/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Ofcourse
Bandi post good

Mark as Answer if its helpful to you

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/30/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
thank you jayakumar

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 11/5/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
You can use UTC date as getutcdate in sql server

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response