473,396 Members | 1,775 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,396 software developers and data experts.

Need to get Time down to the 0.1 seconds in a number string

Hello,

I need to get the time down the the 0.1 second in a number string.

Example

09-06-03 13:45 23.4 Seconds

To "0906031345234"

Thanks in advance,

Jack
Nov 20 '05 #1
7 1708
You could use the RegEx class to remove all characters, except digits.
Something like

newString = RegEx.Replace("10-03-06 10:31 23.4 Seconds", "^[0-9]", "")

"jack" <ja**@mrolinux.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello,

I need to get the time down the the 0.1 second in a number string.

Example

09-06-03 13:45 23.4 Seconds

To "0906031345234"

Thanks in advance,

Jack

Nov 20 '05 #2
Minor mistake in that, should read:

newString = RegEx.Replace("10-03-06 10:31 23.4 Seconds", "[^0-9]", "")

Remember to Import System.Text.RegularExpressions

"Richard Brown" <rb****@easylift.org> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
You could use the RegEx class to remove all characters, except digits.
Something like

newString = RegEx.Replace("10-03-06 10:31 23.4 Seconds", "^[0-9]", "")

"jack" <ja**@mrolinux.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello,

I need to get the time down the the 0.1 second in a number string.

Example

09-06-03 13:45 23.4 Seconds

To "0906031345234"

Thanks in advance,

Jack


Nov 20 '05 #3
Hi Jack,

|| I need to get the time down the the 0.1 second in a number string.

?? I don't understand this.
But looking at your example, there are a number of solutions of which here's one:

If the string is always in <exactly> the same format you can just copy out
the required portions:

T = "09-06-03 13:45 23.4"
sNumbers = Mid (T, 1, 2) & Mid(T, 4, 2) & etc.

Regards,
Fergus

[Sorry about replying directly - I hit the wrong Reply button]
Nov 20 '05 #4
Nak
> [Sorry about replying directly - I hit the wrong Reply button]

Yeah yeah, you're just building your very own client base, adding to that
great Fergusoft empire where world domination is the only goal. Determined
to change the rules of the software world and to drive smaller companies
into liquidation, "tsk" and "tsk" and more "tsk"'ing sounds made in your
general direction!!!

BTW have you seen...

http://microscum.kurttrail.com/

I first came across this site when I first joined this newsgroup stangely
enough, there was a guy REALLY kicking off at anyone representing Microsoft.
I have only just got around to reading the "details" within his web site so
to speak and was quite suprised at the little snippets of information that I
picked up.... like shrink wrap licenses for example, now if you ever needed
a giant "tsk"'ing machine for anything, it should be for that, oh well, alls
fair in world domination! ;-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #5
Hi Nick,

LOL

Fergus J. Cooney Esq, BSc, DIT
Managing Director,
FergusSoft,
A member of the
Fergus Group of Companies.
Nov 20 '05 #6
Jack,
In addition to the others comments.

Is you time in a DateTime object?

I would use a custom format:

' Create your date time as:
' year, month, day, hour, minute, second, milliseconds
Dim d As New DateTime(3, 9, 6, 13, 45, 23, 400)

Dim s As String = d.ToString("MMddyyHHmmssf")

Which says 2 digit month, 2 digit day, 2 digit year, 2 digit (24) hour, 2
digit minute, 2 digit second, 1 digit fraction of second.

For details on Date Time formatting see:
http://msdn.microsoft.com/library/de...matstrings.asp

However, why are you using m/d/y in your format string? I would think y/m/d
would be safer, at least y/m/d sorts "better".

Hope this helps
Jay

"jack" <ja**@mrolinux.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello,

I need to get the time down the the 0.1 second in a number string.

Example

09-06-03 13:45 23.4 Seconds

To "0906031345234"

Thanks in advance,

Jack

Nov 20 '05 #7
Nak
> Fergus J. Cooney Esq, BSc, DIT
Managing Director,
FergusSoft,
A member of the
Fergus Group of Companies.


LOL

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #8

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

Similar topics

6
by: Stefan Behnel | last post by:
Hi! The logging module nicely prepends each line with a formatted date. However, I'm not interested in the actual date but only in the number of milliseconds that passed since the start of the...
3
by: rsherman | last post by:
I am running a windows app. with a stored procedure and the stored proc runs up to 90 seconds, the time out in the connection string is set for 90 seconds. It seems that the time out setting is...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
4
by: Andrew Poulos | last post by:
How do I convert a length of time, measured in seconds, into a "point in time" type time interval or what's represented as: time (second,10,2) The format is: PS]] where: y: The number of...
6
by: Penguin | last post by:
At some long ago time Steve Jorgensen answered thus: Subject: Re: How can I round a time? Newsgroups: comp.databases.ms-access Date: 1998/12/11 Access represents a date internally as a double...
5
by: Sinan Nalkaya | last post by:
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when...
37
by: David T. Ashley | last post by:
I have Red Hat Enterprise Linux 4. I was just reading up about UTC and leap seconds. Is it true on my system that the Unix time may skip up or down by one second at midnight when there is a...
0
by: M.-A. Lemburg | last post by:
On 2008-05-08 14:31, Gabriel Genellina wrote: Using mxDateTime that's pretty easy (using number of days): 3050:18:01:25.91 or, if you'd rather like to see things broken down as relative...
4
by: ndedhia1 | last post by:
I am reading in a file to see what delays I am getting on what IP address: QuoteBlockTiming exceeded 1000 ms: 1684 --- Fri Nov 06 06:09:10 CST 2009 170.137.94.95 Class key = 649126730 block...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.