473,770 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting from local -> UTC

Hi,

I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UTC offset. I've tried looking through the
docs http://python.active-venture.com/lib...datetime.html), but
have not had any luck.

Does anyone have any suggestions? Any help would be greatly
appreciated.

Thanks,
Keith
Jul 11 '08 #1
11 3908
En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt
<ke***********@ gmail.comescrib i�:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UTC offset. I've tried looking through the
docs http://python.active-venture.com/lib...datetime.html), but
have not had any luck.
You have to use a "timezone aware" datetime object. If all you want is to
store an UTC date, the tzinfo demo classes that you can find in the Python
docs at <http://docs.python.org/lib/datetime-tzinfo.htmlmay be enough.
A more complete implementation is at <http://pytz.sourceforg e.net/>

If you pass a "timezone aware" datetime object as a SQL parameter, the
database should store it correctly (but I don't have a MySQL instance at
hand to test it)

--
Gabriel Genellina

Jul 12 '08 #2
Gabriel Genellina <ga*******@yaho o.com.ar>:
En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt
<ke***********@ gmail.comescrib i�:
>I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UTC offset. I've tried looking through the
docs http://python.active-venture.com/lib...datetime.html), but
have not had any luck.

You have to use a "timezone aware" datetime object. If all you want is to
store an UTC date, the tzinfo demo classes that you can find in the Python
docs at <http://docs.python.org/lib/datetime-tzinfo.htmlmay be enough.
A more complete implementation is at <http://pytz.sourceforg e.net/>
The python-dateutil package also provide classes to deal with timezone-aware
datetime objects. See <http://labix.org/python-dateutil>

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
Jul 12 '08 #3
On Jul 12, 12:52Â*am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt Â*
<keith.hugh...@ gmail.comescrib i�:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UTC offset. I've tried looking through the
docshttp://python.active-venture.com/lib/datetime-datetime.html), but
have not had any luck.

You have to use a "timezone aware" datetime object. If all you want is toÂ*
store an UTC date, the tzinfo demo classes that you can find in the Python Â*
docs at <http://docs.python.org/lib/datetime-tzinfo.htmlmay be enough.
A more complete implementation is at <http://pytz.sourceforg e.net/>

If you pass a "timezone aware" datetime object as a SQL parameter, the Â*
database should store it correctly (but I don't have a MySQL instance at Â*
hand to test it)

--
Gabriel Genellina
Thanks for advice Gabriel. I downloaded the tzinfo demo class, saved
it as
UTC.py and imported it. I'm still not exactly sure how to use it
though. It looks like
the file already creates an instance of the UTC tzinfo class (line 20:
"utc = UTC()"),
however, when I try to test it out in the interpreter, it cannot be
found. I'm new
to python, and there is probably something obvious I'm missing, but do
you have any ideas?
Here is what I'm attempting:

============ output begin =============

Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>import datetime, UTC
t = datetime.dateti me(2008, 7, 14, 00, 00, 00, UTC())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>utc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'utc' is not defined
>>utc = UTC()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>>
============ output begin =============

Any ideas?

Thanks,
Keith
Jul 14 '08 #4
En Mon, 14 Jul 2008 12:06:30 -0300, Keith Hughitt
<ke***********@ gmail.comescrib ió:
On Jul 12, 12:52*am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
>En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt *
<keith.hugh... @gmail.comescri bió:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UTC offset. I've tried looking through the
docshttp://python.active-venture.com/lib/datetime-datetime.html), but
have not had any luck.

You have to use a "timezone aware" datetime object. If all you want is
to *
store an UTC date, the tzinfo demo classes that you can find in the
Python *
docs at <http://docs.python.org/lib/datetime-tzinfo.htmlmay be enough.

Thanks for advice Gabriel. I downloaded the tzinfo demo class, saved
it as
UTC.py and imported it. I'm still not exactly sure how to use it
though. It looks like
the file already creates an instance of the UTC tzinfo class (line 20:
"utc = UTC()"),
however, when I try to test it out in the interpreter, it cannot be
found. I'm new
to python, and there is probably something obvious I'm missing, but do
you have any ideas?
The import statement in Python doesn't behave the same way as similar
statements in other languages - and it may be confusing you. I'll try to
explain it using this example.
You have:
- a *file* UTC.py, containing the source code for the *module* UTC. It
contains:
- a *class* definition (UTC) and
- an *instance* of that class, utc.

--- begin UTC.py ---
class UTC(tzinfo):
...
utc = UTC()
....
--- end UTC.py ---
Here is what I'm attempting:

============ output begin =============

Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>>import datetime, UTC
Here you have imported the *module* UTC. That is, the name UTC now refers
to a newly created module just loaded from the UTC.py file.
>>>t = datetime.dateti me(2008, 7, 14, 00, 00, 00, UTC())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
The error comes from UTC(): UTC is a module, UTC() is attempting to "call"
it, and since modules are not callable objects, we get a TypeError.
>>>utc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'utc' is not defined
The *only* name we have imported so far is UTC - the module. Lowercase utc
isn't defined.
>>>utc = UTC()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Same as above...

Ok, how to solve it? We know that UTC refers to the *module* with the same
name. To get the *class* inside that module, use UTC.UTC - try again in
the interpreter. To create a new instance of that class, you can use
UTC.UTC(). To obtain the instance already created in the UTC module, use
UTC.utc

**OR**

Import those names explicitely:

pyfrom UTC import UTC

In this case the name UTC refers to the *class* inside the module.
In this particular example it may be confusing - both have the same name.
Another example from the standard library: the poplib module contains a
POP3 class, so after executing this line:

pyfrom poplib import POP3

the name POP3 refers to that class. The poplib module itself isn't
directly available.
Back to the UTC module, you could use:

pyfrom UTC import utc

and now utc refers to the *instance* already created inside the module.
This last form may be the most convenient in your case:

pyimport datetime
pyfrom UTC import utc
pyprint datetime.dateti me(2008, 7, 14, 20, 30, 0, 0, utc)
2008-07-14 20:30:00+00:00

--
Gabriel Genellina

Jul 15 '08 #5
Thanks Gabriel!

That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'

So far, what I've been doing is building the query as a string, for
example:

query = "INSERT INTO image VALUES(%d, %d, %s, '%s')" % (id, meas,
date, 'jpg')
cursor.execute( query)

This works fine for regular datetime objects, which are passed as
strings similar
to: "2003-10-01 00:00:00." When incorporating a timezone, however, the
resulting string
is of the form "2003-10-01 00:00:00+00:00. " Unfortunately, MySQL does
not recognize
the offset.

I know you said you don't use MySQL, but how would you do something
execute a similar query
on the database you normally interface with?
Thanks,
Keith
On Jul 15, 12:04*am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
En Mon, 14 Jul 2008 12:06:30 -0300,KeithHughi tt *
<keith.hugh...@ gmail.comescrib ió:
On Jul 12, 12:52*am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
En Fri, 11 Jul 2008 15:42:37 -0300,KeithHughi tt *
<keith.hugh...@ gmail.comescrib ió:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UTC offset. I've tried looking through the
docshttp://python.active-venture.com/lib/datetime-datetime.html), but
have not had any luck.
You have to use a "timezone aware" datetime object. If all you want is*
to *
store an UTC date, the tzinfo demo classes that you can find in the *
Python *
docs at <http://docs.python.org/lib/datetime-tzinfo.htmlmay be enough.
Thanks for advice Gabriel. I downloaded the tzinfo demo class, saved
it as
UTC.py and imported it. I'm still not exactly sure how to use it
though. It looks like
the file already creates an instance of the UTC tzinfo class (line 20:
"utc = UTC()"),
however, when I try to test it out in the interpreter, it cannot be
found. I'm new
to python, and there is probably something obvious I'm missing, but do
you have any ideas?

The import statement in Python doesn't behave the same way as similar *
statements in other languages - and it may be confusing you. I'll try to *
explain it using this example.
You have:
- a *file* UTC.py, containing the source code for the *module* UTC. It *
contains:
- a *class* definition (UTC) and
- an *instance* of that class, utc.

--- begin UTC.py ---If you pass a "timezone aware" datetime object as a SQL parameter
class UTC(tzinfo):
* *...
utc = UTC()
...
--- end UTC.py ---
Here is what I'm attempting:
============ output begin =============
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>import datetime, UTC

Here you have imported the *module* UTC. That is, the name UTC now refers*
to a newly created module just loaded from the UTC.py file.
>>t = datetime.dateti me(2008, 7, 14, 00, 00, 00, UTC())
Traceback (most recent call last):
* File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

The error comes from UTC(): UTC is a module, UTC() is attempting to "call" *
it, and since modules are not callable objects, we get a TypeError.
>>utc
Traceback (most recent call last):
* File "<stdin>", line 1, in <module>
NameError: name 'utc' is not defined

The *only* name we have imported so far is UTC - the module. Lowercase utc *
isn't defined.
>>utc = UTC()
Traceback (most recent call last):
* File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

Same as above...

Ok, how to solve it? We know that UTC refers to the *module* with the same *
name. To get the *class* inside that module, use UTC.UTC - try again in *
the interpreter. To create a new instance of that class, you can use *
UTC.UTC(). To obtain the instance already created in the UTC module, use *
UTC.utc

**OR**

Import those names explicitely:

pyfrom UTC import UTC

In this case the name UTC refers to the *class* inside the module.
In this particular example it may be confusing - both have the same name.*
Another example from the standard library: the poplib module contains a *
POP3 class, so after executing this line:

pyfrom poplib import POP3

the name POP3 refers to that class. The poplib module itself isn't *
directly available.
Back to the UTC module, you could use:

pyfrom UTC import utc

and now utc refers to the *instance* already created inside the module. *
This last form may be the most convenient in your case:

pyimport datetime
pyfrom UTC import utc
pyprint datetime.dateti me(2008, 7, 14, 20, 30, 0, 0, utc)
2008-07-14 20:30:00+00:00

--
Gabriel Genellina
Jul 16 '08 #6
In message
<46************ *************** *******@2g2000h sn.googlegroups .com>, Keith
Hughitt wrote:
I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a
UTC date ...
>>import calendar
calendar.time gm((2008, 7, 11, 0, 0, 0, 0, 0, -1))
1215734400

ldo@theonTZ=NZ date -d "00:00:00 01-Jan-1970Z +1215734400 seconds"
Fri Jul 11 12:00:00 NZST 2008

The general form of the call is "calendar.timeg m((Y, M, D, hh, mm, ss, 0,
0, -1))".

See also <http://docs.python.org/lib/module-time.html>,
<http://docs.python.org/lib/module-calendar.html>.
... so that when I send it to MySQL (which treats all dates at local dates
by default) ...
I don't like to use MySQL's date/time types. Instead, I usually have a
simple integer field containing seconds since some origin time in UTC. If
the time is that of some event, an origin of 00:00:00 01-Jan-1970 lets you
use Unix/Linux system times directly. For recording dates/times that might
go further back (e.g. dates of birth, historical events), I have used the
Julian day origin, 1st January 4713 BC.
Jul 17 '08 #7
On 2008-07-16 20:00, Keith Hughitt wrote:
Thanks Gabriel!

That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'

So far, what I've been doing is building the query as a string, for
example:

query = "INSERT INTO image VALUES(%d, %d, %s, '%s')" % (id, meas,
date, 'jpg')
cursor.execute( query)
Use binding parameters and it should work:

query = "INSERT INTO image VALUES(%d, %d, %s, '%s')"
cursor.execute( query, (id, meas, date, 'jpg'))

Database interfaces typically do not support timezones, so I'm not
sure why you are making things more complicated by adding a timezone
to the date/time value.
This works fine for regular datetime objects, which are passed as
strings similar
to: "2003-10-01 00:00:00." When incorporating a timezone, however, the
resulting string
is of the form "2003-10-01 00:00:00+00:00. " Unfortunately, MySQL does
not recognize
the offset.

I know you said you don't use MySQL, but how would you do something
execute a similar query
on the database you normally interface with?
Thanks,
Keith
On Jul 15, 12:04 am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
>En Mon, 14 Jul 2008 12:06:30 -0300,KeithHughi tt
<keith.hugh... @gmail.comescri bió:
>>On Jul 12, 12:52 am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
En Fri, 11 Jul 2008 15:42:37 -0300,KeithHughi tt
<keith.hugh. ..@gmail.comesc ribió:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporate d the proper UTC offset. I've tried looking through the
docshttp://python.active-venture.com/lib/datetime-datetime.html), but
have not had any luck.
You have to use a "timezone aware" datetime object. If all you want is
to
store an UTC date, the tzinfo demo classes that you can find in the
Python
docs at <http://docs.python.org/lib/datetime-tzinfo.htmlmay be enough.
Thanks for advice Gabriel. I downloaded the tzinfo demo class, saved
it as
UTC.py and imported it. I'm still not exactly sure how to use it
though. It looks like
the file already creates an instance of the UTC tzinfo class (line 20:
"utc = UTC()"),
however, when I try to test it out in the interpreter, it cannot be
found. I'm new
to python, and there is probably something obvious I'm missing, but do
you have any ideas?
The import statement in Python doesn't behave the same way as similar
statements in other languages - and it may be confusing you. I'll try to
explain it using this example.
You have:
- a *file* UTC.py, containing the source code for the *module* UTC. It
contains:
- a *class* definition (UTC) and
- an *instance* of that class, utc.

--- begin UTC.py ---If you pass a "timezone aware" datetime object as a SQL parameter
class UTC(tzinfo):
...
utc = UTC()
...
--- end UTC.py ---
>>Here is what I'm attempting:
=========== = output begin =============
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>import datetime, UTC
Here you have imported the *module* UTC. That is, the name UTC now refers
to a newly created module just loaded from the UTC.py file.
>>>>>t = datetime.dateti me(2008, 7, 14, 00, 00, 00, UTC())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
The error comes from UTC(): UTC is a module, UTC() is attempting to "call"
it, and since modules are not callable objects, we get a TypeError.
>>>>>utc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'utc' is not defined
The *only* name we have imported so far is UTC - the module. Lowercase utc
isn't defined.
>>>>>utc = UTC()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Same as above...

Ok, how to solve it? We know that UTC refers to the *module* with the same
name. To get the *class* inside that module, use UTC.UTC - try again in
the interpreter. To create a new instance of that class, you can use
UTC.UTC(). To obtain the instance already created in the UTC module, use
UTC.utc

**OR**

Import those names explicitely:

pyfrom UTC import UTC

In this case the name UTC refers to the *class* inside the module.
In this particular example it may be confusing - both have the same name.
Another example from the standard library: the poplib module contains a
POP3 class, so after executing this line:

pyfrom poplib import POP3

the name POP3 refers to that class. The poplib module itself isn't
directly available.
Back to the UTC module, you could use:

pyfrom UTC import utc

and now utc refers to the *instance* already created inside the module.
This last form may be the most convenient in your case:

pyimport datetime
pyfrom UTC import utc
pyprint datetime.dateti me(2008, 7, 14, 20, 30, 0, 0, utc)
2008-07-14 20:30:00+00:00

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Jul 17 2008)
>>Python/Zope Consulting and Support ... http://www.egenix.com/
mxODBC.Zope.D atabase.Adapter ... http://zope.egenix.com/
mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
_______________ _______________ _______________ _______________ ____________

:::: Try mxODBC.Zope.DA for Windows,Linux,S olaris,MacOSX for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
Jul 17 '08 #8
On 2008-07-17 22:43, Dennis Lee Bieber wrote:
On Thu, 17 Jul 2008 19:55:44 +0200, "M.-A. Lemburg" <ma*@egenix.com >
declaimed the following in comp.lang.pytho n:

>Use binding parameters and it should work:

query = "INSERT INTO image VALUES(%d, %d, %s, '%s')"

If this is MySQLdb interface:

query = "INSERT INTO image VALUES(%s, %s, %s, '%s')"

... only %s is valid; all values have been converted to escaped/quoted
string before getting to the substitution.
Right. I forgot to replace the %d's with %s's. The line should read:

query = "INSERT INTO image VALUES(%s, %s, %s, %s)"

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, Jul 17 2008)
>>Python/Zope Consulting and Support ... http://www.egenix.com/
mxODBC.Zope.D atabase.Adapter ... http://zope.egenix.com/
mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
_______________ _______________ _______________ _______________ ____________

:::: Try mxODBC.Zope.DA for Windows,Linux,S olaris,MacOSX for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
Jul 17 '08 #9
En Wed, 16 Jul 2008 15:00:50 -0300, Keith Hughitt
<ke***********@ gmail.comescrib i�:
Thanks Gabriel!

That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'

So far, what I've been doing is building the query as a string, for
example:

query = "INSERT INTO image VALUES(%d, %d, %s, '%s')" % (id, meas,
date, 'jpg')
cursor.execute( query)
That's not a good idea, in general (among other problems: what if any text
contains a quote? ever heard of "sql injection"?). Use this form instead:

query = "INSERT INTO image VALUES(%s, %s, %s, %s)"
cursor.execute( query, (id, meas, date, 'jpg'))

Note that I used %s everywhere (it's just a placeholder, not a format) and
the execute method receives two arguments, the second being a tuple
containing the desired values.

--
Gabriel Genellina

Jul 17 '08 #10

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

Similar topics

4
11880
by: Elie Grouchko | last post by:
Hi All 1. I need to convert the local-time of the server on which I run my website to UTC and I don't want to rely on the server local time and timezone (i.e. I don't want to hardcode the timezone information), is there a generic way to do this? 2. Is there a general for converting time between timezones in ASP? Many thanks
2
13099
by: gnv | last post by:
Hi all, I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript program to save an XML file to local file system. I have an xml string like below: var xmlStr = "<?xml version="1.0" encoding="UTF-8"?><a>some info</a>"; I want to save this xml file to local file system with JavaScript,
6
4835
by: Jim Davis | last post by:
Before I reinvent the wheel I thought I'd ask: anybody got a code snippet that will convert the common ISO8601 date formats to a JS date? By "common" I mean at the least ones described in this W3C note: http://www.w3.org/TR/NOTE-datetime For my requirements the code would be need to be open sourceable under the BSD license.
3
9927
by: Stephan Brunner | last post by:
Hi I have created two flavors of an XSLT stylesheet to transform all attributes of an XML document to elements: They both work as expected with MSXML and XMLSPY but throw an exception ========================= <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0"
8
4718
by: Uttam | last post by:
Hello, I am currently in the process of developing an application in a pure desktop world using Access 2000. I am intending to convert this pure desktop application into a Client Server application with Access 2000 as the front end and the each of the following as the backend: 1) Oracle
2
2737
by: Brian Candy | last post by:
I am guessing that this must be a common question, but I just can't find a simple solution for it by searching the newsgroups. I have a Text Box with a date in a UK format. The format has been verified and is legal. Now all I want to do is pop it into an SQL field. Debugging on my local machine everything works with the following: dDOB = CDate(txtDOB) Row.Item("DOB") = dDOB But when deployed this would fail because CDate requires...
2
8777
by: Sileesh | last post by:
HI I know this is not the right forum to post this question, but i think some one might have a suggestion. I have a Table "Test" with columns Id bigint (PK), Number Varchar(50), Notes ntext. in sql server 2000 I ahve a stored procedure in which i am trying to insert the same data as new record with column "Number" changed.
2
2295
by: John Wilson | last post by:
I have an application that can access data both locally and through web services (it may be working in a disconnected mode). I have defined my data objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and placed this on the local machine and the webserver. When I get my Object A back from the webserver, Visual Studio tells me that it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I define objects that...
59
7521
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when the recordset opens a table. When I write Set rst = db.OpenRecordset("MyTable",dbOpenTable, dbReadOnly) I get an error. I believe it's invalid operation or invalid parameter, I'm
0
1243
by: karanovicm | last post by:
Hi I was looking for solution how to get local path for example "D:\Test \Shared Folder" from known "\\server\share", for example if somebody select shared folder using "FolderBrowserDialog" how to get local path or how I can get all shared folders but as local paths not as UNC. I do know how to get opposite, from local path find UNC share name using 'WNetGetUniversalName" Any help is welcome Thanks
0
10254
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, 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...
0
10099
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
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,...
0
9904
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 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...
0
8929
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.