Hi,
I'm trying to enter the time in the following format:
HH:MM:SS AM/PM
e.g. 05:33:21 PM
How can i achieve this from the Date Time object?
DateTime.Now.ToString("?");
I've search MSDN, and they only seem to cater for the 24 hour clock,
not the 12 hour clock
In the meanwhile, i strip the date by using DateTime.Now.Hour.
and then based on if it's greater than 12.
There must be a simpler built in way
TIA 4 23916
Good evening,
DateTime.Now.ToString("hh:mm:ss tt")
Regards
--
Milosz
"Grant Merwitz" wrote:
Hi,
I'm trying to enter the time in the following format:
HH:MM:SS AM/PM
e.g. 05:33:21 PM
How can i achieve this from the Date Time object?
DateTime.Now.ToString("?");
I've search MSDN, and they only seem to cater for the 24 hour clock,
not the 12 hour clock
In the meanwhile, i strip the date by using DateTime.Now.Hour.
and then based on if it's greater than 12.
There must be a simpler built in way
TIA
On Thu, 29 Mar 2007 17:58:25 +0200, Grant Merwitz wrote:
Hi,
I'm trying to enter the time in the following format:
HH:MM:SS AM/PM
e.g. 05:33:21 PM
How can i achieve this from the Date Time object?
DateTime.Now.ToString("?");
I've search MSDN, and they only seem to cater for the 24 hour clock,
not the 12 hour clock
In the meanwhile, i strip the date by using DateTime.Now.Hour.
and then based on if it's greater than 12.
There must be a simpler built in way
TIA
DateTime.Now.ToString("hh:mm tt")
--
Bits.Bytes http://bytes.thinkersroom.com
thanks,
i don't know why i couldn't find that on MSDN
"Milosz Skalecki [MCAD]" <mi*****@DONTLIKESPAMwp.plwrote in message
news:2E**********************************@microsof t.com...
Good evening,
DateTime.Now.ToString("hh:mm:ss tt")
Regards
--
Milosz
"Grant Merwitz" wrote:
>Hi,
I'm trying to enter the time in the following format: HH:MM:SS AM/PM
e.g. 05:33:21 PM
How can i achieve this from the Date Time object?
DateTime.Now.ToString("?");
I've search MSDN, and they only seem to cater for the 24 hour clock, not the 12 hour clock
In the meanwhile, i strip the date by using DateTime.Now.Hour. and then based on if it's greater than 12.
There must be a simpler built in way
TIA
"Rad [Visual C# MVP]" <no****@nospam.comwrote in message
news:11****************@thinkersroom.com...
On Thu, 29 Mar 2007 17:58:25 +0200, Grant Merwitz wrote:
>Hi,
I'm trying to enter the time in the following format: HH:MM:SS AM/PM
e.g. 05:33:21 PM
How can i achieve this from the Date Time object?
DateTime.Now.ToString("?");
I've search MSDN, and they only seem to cater for the 24 hour clock, not the 12 hour clock
In the meanwhile, i strip the date by using DateTime.Now.Hour. and then based on if it's greater than 12.
There must be a simpler built in way
TIA
DateTime.Now.ToString("hh:mm tt")
--
thanks,
i don't know why i couldn't find that on MSDN This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: MGRIDEOUT |
last post by:
Hello ,
I have a sub that gets all records in a table. Then displays the
times in a drop-down list (ddlStartTime). My problem is that the ddl contain
the date AND time. i.e. 9:00 AM in the...
|
by: PK9 |
last post by:
I have a string variable that holds the equivalent of a DateTime value. I
pulled this datetime from the database and I want to strip off the time
portion before displaying to the user.
I am...
|
by: Fritz Switzer |
last post by:
I'd like to have a string assigned the value of a
DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM"
format.
For example:
DateTime.Now.AddMinutes(30) returns "00:30"
...
|
by: Hans Merkl |
last post by:
Does anybody know of a library that can handle strings pf various formats
and conver them to a DateTime value? The strings are coming from a webform
and I can't restrict the input (it's not my...
|
by: Andrew S. Giles |
last post by:
Hello,
I am importing a flat text file, and putting it into a datagrid for display
on a form.
Currently the users have their dates and times seperated. I have two
fields, therefore in the...
|
by: Reny J Joseph Thuthikattu |
last post by:
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'...
|
by: Cor Ligthert |
last post by:
Hello everybody,
Jay and Herfried are telling me every time when I use CDate that using the
datetime.parseexact is always the best way to do String to datetime
conversions. They don't tell why...
|
by: Simon Harvey |
last post by:
Hi all,
I'm having a bit of a problem working with dates. My computer is british,
but I'm developing an american application so I therefore need to use american
dates. But I can't get my...
|
by: Greg Collins [Microsoft MVP] |
last post by:
Will DateTime.Now.ToString("s") ALWAYS return the same formatting (i.e. the sortable XML Schema style formatting) regardless of what culture the operating system is set to?
I've done limited...
|
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...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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: 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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |