Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

date with c#

Name: Anonymous 2010-06-14 15:43

example: today is 14/06/2010 and i have another date that is 25/06/2010...how can i see if the second date is 5 days greater than the first one?

Name: Anonymous 2010-06-14 15:43

Read SICP

Name: Anonymous 2010-06-14 15:46

>>1
find a function which converts it to a number and compare, usualy named something like "utime".

next!

Name: Anonymous 2010-06-14 15:59

Treat them as fractions, duh.

Name: Anonymous 2010-06-14 16:01

there is no functions like that...
what do you mean by fraction?

Name: Anonymous 2010-06-14 16:03

>>1
(DateTime.Parse("25/06/2010") - DateTime.Parse("14/06/2010")).TotalDays

Also the second date is 11 days greater than the first one, you silly.

Be aware that DateTime.Parse depends on current culture and so might behave unexpectedly in Retarded States of Murka where they like their month first, then day, then year.

Name: Anonymous 2010-06-14 16:10

>>5
As in, fractions. '/' is the divide sign.

Name: Anonymous 2010-06-14 16:11

it works thanks

Name: Anonymous 2010-06-14 16:18

>>6
Don't do that. It will only encourage them.

Name: Anonymous 2010-06-14 18:12

>>6
that may also behave unexpectedly in countries where they use a sane format like YYYY-MM-DD.
((new DateTime(2010, 6, 25)) - (new DateTime(2010, 6, 14))).TotalDays

Name: Anonymous 2010-06-14 18:33

>>4
(define date1 (/ 14 6 2010))
(define date2 (/ 25 6 2010))

(define (date x y)
    (cond ((< x y) (- y x))
        (else (- x y))))

Am I doing it right yet?

Name: Anonymous 2010-06-14 18:53

I'm going on a date with C#. Where should we go?

Name: Anonymous 2010-06-14 20:25

>>12
To see c, I heard it was really good! Endorsed by critics like linus

Name: Anonymous 2010-12-26 3:33

Don't change these.
Name: Email:
Entire Thread Thread List