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

Convert date

The default date-time format is what I would like to get.
My default (in windows) is: 24.12.2003 22:00:00

But with System.Globalization.CultureInfo.CurrentCulture I get american
values, also in my activeX:dateTimePicker I also get american values. I
would like to change it but I don't know where?

if I convert dt with this function:

dt = DateTime.ParseExact(string, "dd.MM.yyyy h:mm:ss",
System.Globalization.CultureInfo.CurrentCulture)

I get as a result:

dt =#12/24/2003 10:00:00 PM#

but I would like to get without PM and AM:

dt= #12/24/2003 22:00:00#
or in fact:
dt= #24.12.2003 22:00:00#

How can I set that, change the
System.Globalization.CultureInfo.CurrentCulture?

Thank you,
Simon
Nov 20 '05 #1
3 1912
try HH for the hour

hope it helps

eric

"simon" <si*********@stud-moderna.si> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The default date-time format is what I would like to get.
My default (in windows) is: 24.12.2003 22:00:00

But with System.Globalization.CultureInfo.CurrentCulture I get american
values, also in my activeX:dateTimePicker I also get american values. I
would like to change it but I don't know where?

if I convert dt with this function:

dt = DateTime.ParseExact(string, "dd.MM.yyyy h:mm:ss",
System.Globalization.CultureInfo.CurrentCulture)

I get as a result:

dt =#12/24/2003 10:00:00 PM#

but I would like to get without PM and AM:

dt= #12/24/2003 22:00:00#
or in fact:
dt= #24.12.2003 22:00:00#

How can I set that, change the
System.Globalization.CultureInfo.CurrentCulture?

Thank you,
Simon

Nov 20 '05 #2
"simon" <si*********@stud-moderna.si> schrieb
The default date-time format is what I would like to get.
My default (in windows) is: 24.12.2003 22:00:00

But with System.Globalization.CultureInfo.CurrentCulture I get
american values, also in my activeX:dateTimePicker I also get
american values. I would like to change it but I don't know where?

if I convert dt with this function:

dt = DateTime.ParseExact(string, "dd.MM.yyyy h:mm:ss",
System.Globalization.CultureInfo.CurrentCulture)

I get as a result:

dt =#12/24/2003 10:00:00 PM#

but I would like to get without PM and AM:

dt= #12/24/2003 22:00:00#
or in fact:
dt= #24.12.2003 22:00:00#

How can I set that, change the
System.Globalization.CultureInfo.CurrentCulture?

I don't understand the question. Where do you "get" something? ParseExact
returns a Date object, not a formatted string. Where do you create the
string and where does it appear in the wrong format?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Thank you, it works now.
I tried everything, functions and culture settings and at the end just
instead of hh: HH :)
I wouldnt found this by myself.

Best regards from Slovenia,
Simon
"EricJ" <er******************@ThiSbitconsult.be.TO> wrote in message
news:3f**********************@news.skynet.be...
try HH for the hour

hope it helps

eric

"simon" <si*********@stud-moderna.si> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The default date-time format is what I would like to get.
My default (in windows) is: 24.12.2003 22:00:00

But with System.Globalization.CultureInfo.CurrentCulture I get american
values, also in my activeX:dateTimePicker I also get american values. I
would like to change it but I don't know where?

if I convert dt with this function:

dt = DateTime.ParseExact(string, "dd.MM.yyyy h:mm:ss",
System.Globalization.CultureInfo.CurrentCulture)

I get as a result:

dt =#12/24/2003 10:00:00 PM#

but I would like to get without PM and AM:

dt= #12/24/2003 22:00:00#
or in fact:
dt= #24.12.2003 22:00:00#

How can I set that, change the
System.Globalization.CultureInfo.CurrentCulture?

Thank you,
Simon


Nov 20 '05 #4

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

Similar topics

1
by: Loi Tan Vo | last post by:
Hi, I have a text file that contains a date column. The text file will be imported to database in SQL 2000 server. After to be imported, I want to convert the date column to date type. For...
19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
1
by: Matt | last post by:
I would like to convert a couple informix stored procedures to SQL Server stored procedures. I have no idea how to accomplish this. Here is an example of one of the procedures I need to convert. ...
3
by: jerry.ranch | last post by:
I have a need to convert simple dates (i.e. 02/14/2005) to a number, do some math, and convert back to a date. (in a simple query). The math involves adding or substracting days, and days of the...
2
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings...
1
by: abcabcabc | last post by:
I write an application which can let user define own date format to input, How to convert the date string to date value with end-user defined date format? Example, User Defined Date Format as...
17
by: Terry Jolly | last post by:
New to C# ---- How do I convert a Date to int? In VB6: Dim lDate as long lDate = CLng(Date) In C#
4
by: perryclisbee via AccessMonster.com | last post by:
I have dates of service for several people that range all over each month. ie: patient had dates of service of: 7/3/2006, 7/24/2006 and 7/25/2006. I need to create a new field via a query that...
8
by: deepak_kamath_n | last post by:
Hello, I have the following scenario: 1. My application receives the date from another application as a string 2. The other application is running in a different time zone as compared to my...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.