|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
using a integer variable with a vb.net datetime literalI am trying to incorporate a integer variable with a vb.net datetime
literal. For example: Dim Jan1 As DateTime = (#1/1/2006#) would be a literal for January 1st of this year. But I have a integer variable that represents the current year, intYear, for example. Is there a way to combine the use of a integer variable with the datetime literal? This obviously doesn't work, but I'm trying something like this: Dim Jan1 As DateTime = (#1/1/intYear#) Any help appreciated. Thanks. Steve Steve,
>I am trying to incorporate a integer variable with a vb.net datetime That doesn't quite make sense. Literals are by definition compile-time>literal. constants, not variable. That said, you can do Dim Jan1 As New DateTime(intyear, 1, 1) Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Okay, I didn't explain myself so well, but you answered my question
perfectly. Thanks. Steve Show quoteHide quote "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message news:e3mbkxvPGHA.3728@tk2msftngp13.phx.gbl... > Steve, > >>I am trying to incorporate a integer variable with a vb.net datetime >>literal. > > That doesn't quite make sense. Literals are by definition compile-time > constants, not variable. That said, you can do > > Dim Jan1 As New DateTime(intyear, 1, 1) > > > > Mattias > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup.
Dates are Evil! HELP!
Asynchronous Invoke and the UI thread (using delegates) How to use my default mail client to mail any file? Accessing Mdi Child Form Control form another one What's going on in this ADO2 code Cannot add MSWord reference Countdown/pause/resume timer Adding New member to TextBox.. Testing simple VB code in design time? .NET and MS Word : setting rightAlignment ??? |
|||||||||||||||||||||||