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

Time settings

Hi there,

My problem is the following: I get the current time on the machine by using Now(), but for some
weird reason this machine (happens only on this machine) refuses to show/handle the tt part of the time. Thus all the times I get using anything like Now() or even when assigning a formatted time to a variable it does not show AM/PM.

I presume this is a system settings issue, now I looked at the Date/Time & Regional Settings under the Control Panel and yet it is identical to a machine that works perfectly.

My question is thus where does VB.Net get its System Time from and where can I see the settings?
Or alternatively can anyone think of a solution to bypass this problem?

Thanx in advance
Edwin

--------------------------------
From: Edwin Loubser

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>r4D8DFQg00207+6E5j+cDA==</Id>
Nov 22 '05 #1
1 1401
Edwin,

AM/PM is only showed in cultures where that is used. That is for sure in
Australia, the USA and Canadian English and I thought the UK. I don't know
which cultures use this as well. However you have to look to the country
settings of the computer.

(You can force this as well, however be sure that you set it back to the
original to become not in problems)

A little sample

\\\
Public Class Main
Public Shared Sub Main()
Threading.Thread.CurrentThread.CurrentCulture = _
New Globalization.CultureInfo("en-AU")
'When you are not in the culture with this settingtis
MessageBox.Show(CDate("01-JUNE-2004 11:59 PM").AddDays(1).ToString)
'Above is the only thing what is needed when it is in your own culture
setting
'And set the culture back when it was not your own culture
Threading.Thread.CurrentThread.CurrentCulture = _
Globalization.CultureInfo.InstalledUICulture
End Sub
End Class
///

I hope this helps,

Cor
Nov 22 '05 #2

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

Similar topics

0
by: Gernot Saborowski | last post by:
To all IIS/ASP-professionals, we just upgraded from one machine to another and are experiencing some strange date time number problems. Both systems have been set up like this: - MS Windows...
2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
1
by: Edwin Loubser via .NET 247 | last post by:
Hi there, My problem is the following: I get the current time on the machine by using Now(), but for some weird reason this machine (happens only on this machine) refuses to show/handle the tt...
0
by: Robert McGregor | last post by:
Using the follwing code and getting the error message: Run time error '2455': You entered an expression that contains an invalid reference to the property MaxRecButton. My code just...
3
by: Just D | last post by:
Did anybody see this bug? I tried to reproduce that using 12-hour and 24-hour system settings. Anyway it still causes a problem in VS2003. When I convert DateTime to a string using default...
0
by: Harold Crump | last post by:
Greetings, I am using SQL Server for state management in an ASP.NET application. The ASPStateTempSessions table is being stored in the ASPState table (and not the SQL Temp database). I am...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
2
by: autenzio | last post by:
I want to be able to load up the items collection of a combobox with string values I create in Application settings. I have created a collection of strings in the Settings window, but I am unable...
0
by: =?Utf-8?B?RXJpYyBTbWl0aA==?= | last post by:
I'm writing a Windows service that has a few settings. I used the settings designer to add a Settings class, and added my settings with application scope. I've also created a subclass of...
1
by: anilareddy | last post by:
I have an application like this. I need to validate the start time in 2nd row against the start row in first row. I mean The start time value entered in the second row must not b the value entered in...
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.