Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi guys,

I have created one web and windows based application and these both applications are in multilingual langauges(English, Arabic, Hindi, Philiphinne).

This application is created for ExamCenters.

In which they will create Exam Session. When Exam Sessions are created, the date & time is stored in DB is Sarver Date&Time.

Now, the client will login from INDIA, SAUDI ARABIA, UAE, PHILIPHINE, PAKISTAN

I have to set and match the server time with the client local time.

What I have tried:

I have tried using DateTime.UtcNOW;

But its also giving server time only.

Can any one please help me.



Thanks
Posted
Updated 11-Dec-16 22:14pm

Always use UTC when storing and comparing dates and times.

Only when displaying them, they may be converted to local time.

If the clients are displaying (e.g. using JavaScript), convert the UTC time passed from the server to local time.

If the server is displaying, it needs information about the time zone for each client. This is usually stored in a database together with the other client data.
 
Share this answer
 
Anything you do on the server side (in the c# code) will take the server time.

Please perform a quick search either in the forums or in google before posting here:
How to get the date time of client PC in asp.net C#?[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900