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

now.tolongtimestring.tostring

Hi,

I used the above and I got

"4:08:16 PM"

but I need

"16:08:16"

Has anyone done this before?

Please help! Thanks!

Greg
Nov 21 '05 #1
3 3471
"Greg Chu" <gr******@wendys.com> schrieb:
[...]


I replied in the vb.controls group.

Please don't multipost...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
One way to do it, albeit maybe not the best...

if now.tolongtimestring.substring(instrrev(now.tolong timestring, " "))
= "PM" then
now.date.addhours(12)
end if

Greg Chu wrote:
Hi,

I used the above and I got

"4:08:16 PM"

but I need

"16:08:16"

Has anyone done this before?

Please help! Thanks!

Greg


Nov 21 '05 #3
Greg,

When you really need it like this, you can use the ToString for setting the
format.

What you want is what I assume
16 hour, 8 minutes, 16 seconds what is used in the my and I think more EU
and other cultures as a kind of standard format for the non analoge clock.
In the USA this is called "military format".

When it is not your standard culture setting, than you can try.

dim mydate as string = Now.toString(HH:mm:ss)

I hope this helps?

Cor



"Greg Chu" <gr******@wendys.com> schreef in bericht
news:eD**************@TK2MSFTNGP10.phx.gbl...
Hi,

I used the above and I got

"4:08:16 PM"

but I need

"16:08:16"

Has anyone done this before?

Please help! Thanks!

Greg

Nov 21 '05 #4

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

Similar topics

7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
6
by: Joe | last post by:
Stupid question, but I'm really stuck I have a class that overrides ToString(). When this class is cast back to Object, and ToString() called, Object.ToString() is called instead. I've tried...
8
by: John Cobb | last post by:
Excuse me if I use some terminology incorrectly as I am not well versed in Object Orientation. In short I want to create an Enumerated type similar to the following Enum Monitor as Byte Small...
10
by: | last post by:
I have a property where I want to associate tostring with it. So that this would be valid: ----- Dim x as string x = myobject.myproperty.tostring ----- I know I have to overide...
0
by: bcobra | last post by:
What am I doing wrong? the code: age Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"...
7
by: Dylan Parry | last post by:
Hi folks, I was wondering if there is any way of formatting a date to include the ordinal characters? I've looked at the documentation for DateTime.ToString(), but no where can I find...
2
by: archana | last post by:
Hi all, I am facing some wired problem while using above mention data type. What i am doing is i am writing DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" +...
2
by: Berryl Hesh | last post by:
I'm interested in how experienced.Net developers might handle routine display tasks as a general strategy. Let's say you have a use in your domain for value objects that encapsulate a person's...
19
by: Michael C | last post by:
If we have something like this object x = null; MessageBox.Show(x.ToString()) we get an error. That kindof makes sense but there is no reason the behaviour couldn't be to return an empty...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...

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.