RE: Date Compare

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Peter,

Welcome to the ASP.NET newsgroup.

From your description, I understand you have a certain ASP.NET web page
which contain two text field to let user input date time and you need to
compare the date/time in the two text fields. Since the input date's
format in the two text fields may vary, you're wondering a simple and
better means to compare them(the string format ), correct?

Based on my experience, since the input data in the text fields are of text
format and the format of the date/time may also vary, the better approach
maybe postback the page and parse the data in text field into .net DateTime
class instance and do the comparation. Is it posslbe that you do the work
at serverside like this?

For clientside, date/time parsing and format functionality are limited.
There does exists an Date class(javascript class object) which has parse
method and other client script methods, however not all the browsers will
support them. Anyway, here are some web article introduce use the
javascript Date object:

METHOD: Date::parse
http://www.devguru.com/Technologies/ecmascript/quickref/date_parse.html

http://www.comptechdoc.org/independent/web/cgi/javamanual/javadate.html

.



Relevant Pages

  • Re: mm/dd/yyyy format question
    ... I was not talking about how .Net or SQL Server stores date/time values ... I get the impression that you are talking about ISO 8601 in terms ... applications use the format for unambiguously representing date/time ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Leading zeroes, text/numbers, import/export
    ... >If I want to do arithmetic, use a numeric format. ... >> We import into Excel and sometimes later export to ... >> can compare them from one list or sheet to another, ... Then, when comparing to other lists or exporting, ...
    (microsoft.public.excel.misc)
  • RE: Timesheet entering blocks of time with a value
    ... INSERT INTO yourTable (EmpID, PayPeriod, WorkDate, WorkCode, Hours) ... cboDateTo (Date/Time, Long date Format), ... How do I limit the days available OR populate the cboDateFrom and cboDateTo ...
    (microsoft.public.access.modulesdaovba)
  • Re: Help with comparing date stamp in PHP to date AND time stamp coming from MYSQL db!!!!!!
    ... the time limitation to pull the username out of the DB. ... date formats and how to compare them for my little script. ... So when the user logs in again, ... So I can't change the date format ...
    (comp.lang.php)
  • Re: Q: When 0 <> 0 ?
    ... taking the IEEE floating-point format into account, ... I think the answer goes beyond the IEEE FP format to the ... and never compare two FP results ...
    (microsoft.public.excel)