Search:
Namespaces
Discussions
.NET v1.1
Feedback
SV: Re: Calculating dates in .Net
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngmigrate' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
=?iso-8859-1?Q?Andr=E9_Colbi=F6rnsen?=
I keep getting errors saying 'Integer' cannot be converted to 'Date'
Regards/H=E4lsningar
Andr=E9 Colbi=F6rnsen
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
Sonnenburg Communications
Bergsgatan 3,
SE-211 54 Malm=F6
Sweden
Tel.: +46-(0)40-97 78 80
Fax.: +46-(0)40-97 78 80
Mob.: +46-(0)708-97 78 79
Mail:
Click here to reveal e-mail address
Web.: www.sonnenburg.se
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
-----Ursprungligt meddelande-----
Fr=E5n: Marcie Jones [mailto:
Click here to reveal e-mail address
]=20
Skickat: den 13 februari 2002 16:14
Till: aspngmigrate
=C4mne: [aspngmigrate] Re: Calculating dates in .Net
Check out the following methods of
DateTime
variables in .Net: Subtract,
ToShortDateString
See docs:
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemdatetimememberstopic.
htm
Hope this helps!
Marcie
----- Original Message -----
From: =3D?iso-8859-1?Q?Andr=3DE9_Colbi=3DF6rnsen?=3D =
<
Click here to reveal e-mail address
>
To:
Click here to reveal e-mail address
Sent: Wed, 13 Feb 2002 14:33:28 +0100
Subject: Calculating dates in .Net
-- Moved from [aspngfreeforall] to [aspngmigrate] by Marcie Jones
<
Click here to reveal e-mail address
> --
In asp.classic I could calculate a date like this:
Dim made
Made =3D3D rstemp.fields("changed")
IF month(now() - made) > 18 THEN
IF month(now) <> month(made) THEN
RESPONSE.write "<font color=3D3D'red'>" &
formatdatetime(made, vbshortdate) & "<br><br><b>OBS!</b>"
RESPONSE.write GetText(aryElementText, "prodtab_item18")
& "</font>"
ELSE
RESPONSE.write formatdatetime(made, vbshortdate)
END IF
ELSE
RESPONSE.write formatdatetime(made, vbshortdate)
END IF
I have tried to find an easy way to do this in .Net but did not succeed
so far. Could somebody point me in the right direction?
Regards/H=3DE4lsningar
Andr=3DE9 Colbi=3DF6rnsen
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D
=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D
Sonnenburg Communications
Bergsgatan 3,
SE-211 54 Malm=3DF6
Sweden
Tel.: +46-(0)40-97 78 80
Fax.: +46-(0)40-97 78 80
Mob.: +46-(0)708-97 78 79
Mail:
Click here to reveal e-mail address
Web.: www.sonnenburg.se
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D
=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D
| [aspngmigrate] member
Click here to reveal e-mail address
=3D YOUR ID=20
|
http://www.asplists.com/asplists/aspngmigrate.asp
=3D JOIN/QUIT
Reply to this message...
Marcie Jones (VIP)
It's difficult to help you debug your code without seeing it, but you'll =
probably also need to use a TimeSpan:
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemtimespanclasstopic.htm=
If this doesn't help, please send your code.
Marcie
----- Original Message -----
From: =3D?iso-8859-1?Q?Andr=3DE9_Colbi=3DF6rnsen?=3D =
<
Click here to reveal e-mail address
>
To:
Click here to reveal e-mail address
Sent: Wed, 13 Feb 2002 18:47:36 +0100
Subject: SV: [aspngmigrate] Re: Calculating dates in .Net
I keep getting errors saying 'Integer' cannot be converted to 'Date'
Regards/H=3DE4lsningar
Andr=3DE9 Colbi=3DF6rnsen
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D
Sonnenburg Communications
Bergsgatan 3,
SE-211 54 Malm=3DF6
Sweden
Tel.: +46-(0)40-97 78 80
Fax.: +46-(0)40-97 78 80
Mob.: +46-(0)708-97 78 79
Mail:
Click here to reveal e-mail address
Web.: www.sonnenburg.se
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D
-----Ursprungligt meddelande-----
Fr=3DE5n: Marcie Jones [mailto:
Click here to reveal e-mail address
]=3D20
Skickat: den 13 februari 2002 16:14
Till: aspngmigrate
=3DC4mne: [aspngmigrate] Re: Calculating dates in .Net
Check out the following methods of
DateTime
variables in .Net: Subtract,
ToShortDateString
See docs:
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemdatetimememberstopic.
htm
Hope this helps!
Marcie
----- Original Message -----
From: =3D3D?iso-8859-1?Q?Andr=3D3DE9_Colbi=3D3DF6rnsen?=3D3D =3D
<
Click here to reveal e-mail address
>
To:
Click here to reveal e-mail address
Sent: Wed, 13 Feb 2002 14:33:28 +0100
Subject: Calculating dates in .Net
-- Moved from [aspngfreeforall] to [aspngmigrate] by Marcie Jones
<
Click here to reveal e-mail address
> --
In asp.classic I could calculate a date like this:
Dim made
Made =3D3D3D rstemp.fields("changed")
IF month(now() - made) > 18 THEN
IF month(now) <> month(made) THEN
RESPONSE.write "<font color=3D3D3D'red'>" &
formatdatetime(made, vbshortdate) & "<br><br><b>OBS!</b>"
RESPONSE.write GetText(aryElementText, "prodtab_item18")
& "</font>"
ELSE
RESPONSE.write formatdatetime(made, vbshortdate)
END IF
ELSE
RESPONSE.write formatdatetime(made, vbshortdate)
END IF
I have tried to find an easy way to do this in .Net but did not succeed
so far. Could somebody point me in the right direction?
Regards/H=3D3DE4lsningar
Andr=3D3DE9 Colbi=3D3DF6rnsen
=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D=
3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D=3D
3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D
=3D3D3D=3D3D
=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D
Sonnenburg Communications
Bergsgatan 3,
SE-211 54 Malm=3D3DF6
Sweden
Tel.: +46-(0)40-97 78 80
Fax.: +46-(0)40-97 78 80
Mob.: +46-(0)708-97 78 79
Mail:
Click here to reveal e-mail address
Web.: www.sonnenburg.se
=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D=
3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D=3D
3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D
=3D3D3D=3D3D
=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D=3D3D3D
| [aspngmigrate] member
Click here to reveal e-mail address
=3D3D YOUR ID=3D20
|
http://www.asplists.com/asplists/aspngmigrate.asp
=3D3D JOIN/QUIT
Reply to this message...
System.DateTime
System.TimeSpan
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com