Reny,
Is your variable a string or DateTime variable?
Do you want help converting a date from a string, is your date in a specific
format or is that how Windows Formats your dates?
Am I reading your message correctly, you want to round a date up to the next
day?
I would use something like:
Dim s As String = "01-JUNE-2004 11:59 AM"
' converts a string in a specific
Const format As String = "dd-MMMM-yyyy hh:mm tt"
Dim d As DateTime = DateTime.ParseExact(s, format, Nothing)
Dim noon As TimeSpan = TimeSpan.FromHours(12)
' Rounds a date to the nearest day
If d.TimeOfDay.CompareTo(noon) > 0 Then
d = d.Date.AddDays(1)
Else
d = d.Date
End If
Debug.WriteLine(d.ToLongDateString())
Debug.WriteLine(d.ToLongTimeString())
For details on custom datetime formats see:
http://msdn.microsoft.com/library/de...matstrings.asp
For information on formatting in .NET in general see:
http://msdn.microsoft.com/library/de...ttingtypes.asp
Hope this helps
Jay
"Reny J Joseph Thuthikattu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a
> miniute to it.How can i do that?
> by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004
> 12:00 AM'
> How do i do that?
> Reny
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.779 / Virus Database: 526 - Release Date: 19/10/04
>
>