I am trying to convert a string to datetime format and I get an invalid
Date/Time format error. The code I am trying to use is:
msgtime = CDate("Sat, Aug 27 2005 20:00:00 EDT")
I know I can use this format to generete a valid date but how do I correctly
covert time zones?
msgtime = CDate("Sat, Aug 27 2005 20:00:00 GMT")
Any help would be greatly appercaited.
Thanks,
Curtis 3 2178
Curtis,
If you use a datestring, than it has to be in the culture of the computer or
you have to set the culture (something I will not advice you except if you
directly set it back).
Therefore every datetime string is in almost every country in the world
different.
Is this a valid datetime string in your culture?
You know that the most nice method to get a date is using the ISO date with
new date
dim dtm as datetime = new date(2005,9,1,1 2,18,00)
I hope this helps,
Cor
Cor,
Thanks for the reply, so if I understand you correctly their is no way that
VB will convert times from different time zones ? My application has to
process time zones that are in the United States so does that mean I have to
process the time difference manually?
Thanks,
Curtis
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:us******** ******@TK2MSFTN GP15.phx.gbl... Curtis,
If you use a datestring, than it has to be in the culture of the computer or you have to set the culture (something I will not advice you except if you directly set it back).
Therefore every datetime string is in almost every country in the world different.
Is this a valid datetime string in your culture?
You know that the most nice method to get a date is using the ISO date with new date
dim dtm as datetime = new date(2005,9,1,1 2,18,00)
I hope this helps,
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David Graham |
last post by:
Hi
I have asked this question in alt.php as the time() function as used in
setcookie belongs to php - or does it belong equally in the javascript
camp - bit confused about that. Anyway, can anyone here put me straight on
the following:
I had a look at the time() function came across this:
"To clarify, it seems this function returns the time of the computer's clock
and does not do any timezone adjustments to return GMT, so you are...
|
by: Bruce Cushman |
last post by:
My DB is Access 2000 based "possibly written in 2002" and I have to send and
receive update files, ported to a UNIX server by FTP, DB unknown.
The file content uses a fixed length string, zero filled left.
ie;
001332001695001995040601040630
where,
001332,001695,001995,040601,040630
|
by: Mark Reed |
last post by:
Hi Guru's,
I have created a database to monitor hours I have worked as our payroll
department are so crap. I work nights most of the time but occasionally I
have to work on days. Between the hours of 18:00 and 06:00 colleagues get an
unsocial shift allowance. I have managed to get it to work out my gross
income for a 4 week period accounting for overtime ect but I am struggling
to get the unsocial shift allowance included.
All is well...
|
by: Claus Haslauer |
last post by:
Hi,
I want to create a chart
value (y-axis) vs. time (x-axis). In fact very similar to the
xy(scatter) example in the graph10.chm help-file.
I ran into problems, so I started a very basic *.mdb file.
It contains one table with ID, Date, and Price (Value) Column
ID is automatically assigned
Date is in the short date format
|
by: Edward Mitchell |
last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a
format of Time. The controls are all embedded in dialogs. I created the
controls by dragging the DateTime picker from the Toolbox and then set the
Format property appropriately.
I have noticed that sometimes the Time format will reset spontaneously to
Short Date. I looked at the .rc file and found that the usual form for a
Short Date is as follows:
CONTROL ...
| |
by: Shimon Sim |
last post by:
I have a custom composite control
I have following property
|
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 the value in timeonly format by using
this command
Format(now,"HH:mm:ss")
But when I insert it into the Sql Server database, it embadded date value
with it.
the output looks like that "01/01/1900 08:59:00" in that case time is
|
by: Dixie |
last post by:
How can I programatically, take some Date/Time fields present in a table in
the current database and change their type to text?
dixie
|
by: Jerome |
last post by:
Hallo,
I know a lot has already been told about date/time fields in a database but
still confuses me, specif when dealing with SQLserver(Express).
It seems that sqlserver only accepts the date in a "yyyyMMdd" format?
(difference between Express and MSDE2000A ?)
What is the one and only true way to deal with this problem in VB2005:
Local settings are Dutch (Belgium) ; thus date is in "dd/MM/yy" (or perhaps
dd/MM/yyyy) and time in...
|
by: WebCM |
last post by:
There is a function: http://paste.ubuntu.com/21865
It needs GMT date in YYYY-MM-DD HH:MM:SS format - in SQL: datetime. If date is the same as today, the function returns "Today". There
is one problem. This function does not recognize time zones.
How to adjust date to user's time zone? Is converting to timestamp()
and then to format readable to visitors the one and only solution
(e.g. strtotime() + date() OR DateTime object)? Perhaps,...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |