• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 836
  • Last Modified:

ASp.Net/C# - need to check if client date time to EST time

Hello all.

I have in a database a datetime start and end time.  I need to check the client time zone and see if the date time is > then the start date time I have stored and < then the end date time and store that into a boolean flag true or false.

Is there a way I can do this and a good sample?  I have been looking at some but can't find a good solution to handle this.

Thanks
0
sbornstein2
Asked:
sbornstein2
4 Solutions
 
ALaRivaCommented:
It'll have to be done in Javascript, not C#. C# is a server-side language.

Javascript is the only solution to this, however, that makes things tricky since someone could simply modify their time to fit whatever restrictions you have.

Can you explain a bit more on what and how you intend to use this, maybe we can offer an alternative method for going about it.

- Anthony
0
 
Alfred A.Commented:
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Alfred A.Commented:
@rkworlds,

I posted the your suggested link already.  :-)
0
 
Kumaraswamy RCommented:
0
 
MogalManicCommented:
I agree with the 1st poster.  You need to determine the time zone offset on the client.  You can run this javascript:
http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/
and save the value in a hidden field.

Then on the server convert the date time to UTC by applying the time zone offset.  Then convert your server side date time(s) to UTC and compare the dates.
0
 
sbornstein2Author Commented:
Thanks all
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now