473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Date Woes

I am trying to convert a date from this format:

yyyymmddHHMMSS.mmmmmmsUUU

to a format that ASP.NET (VB.NET) understands.

The above date format is used by the WMI datetime type. I don't care about
the mmmmmmsUUU part, as that counts milliseconds and microseconds. The sUUU
is a three digit offset indicating the number of minutes that the
originating time zone deviates from UTC. Other than that, the format is
pretty self explanatory.

(more info here:
http://msdn.microsoft.com/library/de...us/wmisdk/wmi/
date_and_time_format.asp)

I can imagine all kinds of weird, contorted, or otherwise convoluted ways of
formatting this date, but I wanted to check and see if there's an better way
before I go off and spend gobs of time reinventing the wheel.

Any ideas?

-Kevin
Nov 17 '05 #1
3 2991
the easiest way i've seen would probably be:

Dim myDate as Date

myDate = yearstring & "/" & monthstring & "/" & daystring & " " & hourstring
& ":" & minstring

which means you'll have to split up the string somewhere into those
strings...

good luck
"Kevin Vaughn" <ke**********@ttu.edu> wrote in message
news:vg************@corp.supernews.com...
I am trying to convert a date from this format:

yyyymmddHHMMSS.mmmmmmsUUU

to a format that ASP.NET (VB.NET) understands.

The above date format is used by the WMI datetime type. I don't care about the mmmmmmsUUU part, as that counts milliseconds and microseconds. The sUUU is a three digit offset indicating the number of minutes that the
originating time zone deviates from UTC. Other than that, the format is
pretty self explanatory.

(more info here:
http://msdn.microsoft.com/library/de...us/wmisdk/wmi/ date_and_time_format.asp)

I can imagine all kinds of weird, contorted, or otherwise convoluted ways of formatting this date, but I wanted to check and see if there's an better way before I go off and spend gobs of time reinventing the wheel.

Any ideas?

-Kevin

Nov 17 '05 #2
That's really exactly what I was looking for. Thank you for your time.

-Kevin

"Daniel Bass" <da********@postmaster.co.uk> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
the easiest way i've seen would probably be:

Dim myDate as Date

myDate = yearstring & "/" & monthstring & "/" & daystring & " " & hourstring & ":" & minstring

which means you'll have to split up the string somewhere into those
strings...

good luck
"Kevin Vaughn" <ke**********@ttu.edu> wrote in message
news:vg************@corp.supernews.com...
I am trying to convert a date from this format:

yyyymmddHHMMSS.mmmmmmsUUU

to a format that ASP.NET (VB.NET) understands.

The above date format is used by the WMI datetime type. I don't care about
the mmmmmmsUUU part, as that counts milliseconds and microseconds. The

sUUU
is a three digit offset indicating the number of minutes that the
originating time zone deviates from UTC. Other than that, the format is
pretty self explanatory.

(more info here:

http://msdn.microsoft.com/library/de...us/wmisdk/wmi/
date_and_time_format.asp)

I can imagine all kinds of weird, contorted, or otherwise convoluted

ways of
formatting this date, but I wanted to check and see if there's an better

way
before I go off and spend gobs of time reinventing the wheel.

Any ideas?

-Kevin


Nov 17 '05 #3
Regular Expressions are GREAT for this kind of parsing...
Concise, easy to change and understand...

-----Original Message-----
I am trying to convert a date from this format:

yyyymmddHHMMSS.mmmmmmsUUU

to a format that ASP.NET (VB.NET) understands.

The above date format is used by the WMI datetime type. I don't care aboutthe mmmmmmsUUU part, as that counts milliseconds and microseconds. The sUUUis a three digit offset indicating the number of minutes t

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Raven | last post by:
Using either MySQL functions or PHP, how can I convert a date filed in the format of (varchar) Aug 10, 1950 to a unix timestamp? tia
7
by: Mark | last post by:
O, woe is me, to have seen what I have seen, see what I see! (That's Shakespeare for those who were wondering what I'm on about) I am "having fun" with cookies. And I wonder if I have...
2
by: kmeds | last post by:
I am creating a news script in ASP 3.0 with SQL 2000 backend. I'm new to SQL (I used to use Access exclusively... :( ) In any case I have a database of the News set up like this" NewsIDNum int...
3
by: Angel Cat | last post by:
Trying to get my jobs to send mail when job fails. Should be easy but it's giving me headache Had a whole slew of issues. Outlook is installed with a n outlook mail profile set up that can...
2
by: Andrew Thompson | last post by:
- NN 4.78 rendering woes, links at far left - I am trying to rework an old site, make it valid html and css, improving the x-browser and 'older browser' compatibility. My efforts so far, have...
0
by: Arun Bhalla | last post by:
I'm having some inconsistency problems with my deployment project ("Setup") and its custom actions ("Installer"). I'm using Visual Studio .NET 2003 (.NET 1.1, no service pack) on Windows XPSP1. ...
0
by: Rob | last post by:
Hello, I get an date field as a part of download in the format 01 Mar 04 12:00:00. I want this to be converted as a short date.How do i proceed? Also not connected with the above but in the same...
5
by: Kevin | last post by:
I have a simple application that handles authentication, and one of the things it checks is password aging. If I have something like this: If ("02/14/2007" <= Date.Today.ToString("MM/dd/yyyy"))...
8
by: Killer42 | last post by:
Hi all. I have an interesting situation; searching a Date field for my exact value fails, but including it in a range works. I know this sounds like the usual beginner's date/time woes but I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.