datetime issue

  • Thread starter Íéêüëáïò Êïýñáò
  • Start date
Í

Íéêüëáïò Êïýñáò

Ôç ÊõñéáêÞ, 16 Óåðôåìâñßïõ 2012 2:34:34 ì.ì. UTC+3, ï ÷ñÞóôçò Steven D'Aprano Ýãñáøå:
No. That's not how mailing lists work. Every email gets posted to all

members, unless they go onto "No Mail", in which case they get no emails

at all.



You are not paying anything for the help you are receiving, except to

give your own time in return to help others. We are all volunteers here,

and nobody is going to force you to volunteer in return, but if everyone

only received threads that they initiated, nobody would see new threads

and nobody would get any answers at all.

You are right, i will set to receive them all.

But i dont know what to do about the thing you say that i double post.

I use google groups i dont intentionally post to python-list too.

How can i avoid that and just only post to python google group?
 
G

Günther Dietrich

[...]
also it would be nice if datetime.datetime.now(GMT+2) can be used.

In <one of
the first answers to your question you were pointed to pytz. This module
does exactly what you ask for:

If you do a help(pytz), obviously after having imported pytz, you will
get some information about the module. At the end of this help, there
are some attributes listed. One of them is all_timezones. Guess what it
contains?



Best regards,

Günther




PS: I didn't know pytz yet. But it took me just five minutes of reading
the datetime documentation and trying pytz.timezone(), to get a working
example.
So I don't understand, why you didn't follow the proposal of trying
pytz, but claimed, it wouldn't work.
Can you explain, why ist doesn't work for you rsp. what is the error
when it doesn't work?
 
R

Roy Smith

Iam sorry i didnt do that on purpose and i dont know how this is done.

Iam positng via google groups using chrome, thats all i know.

Whats a mailing list?

Is it September already?
 
C

Chris Angelico

Is it September already?

Yes, it is; what does that mean in response to this question? Is there
something about September that causes the question, or is it a once
per month[1] question?

http://en.wikipedia.org/wiki/Eternal_September[/QUOTE]

Ohh, yes. I do remember reading about that. Yes, it is definitely September.

Back in 1993, I wasn't yet started on networking. My dad ran things,
because I was only nine years old, and he definitely (and quite
rightly) didn't let me onto the internet. So I'm a tad young to know
about these things beyond what I've read in the history books...

ChrisA
 
M

MRAB

On 2012-09-16 09:25, Îικόλαος ΚοÏÏας wrote:
[snip]
date = ( datetime.datetime.now() + datetime.timedelta(hours=8) ).strftime( '%y-%m-%d %H:%M:%S')

but iam giving +8 hours which is the time difference between texas, us where the server sits and Greece's time.

cant we somehow tell it to use GMT+2 ?

also it would be nice if datetime.datetime.now(GMT+2) can be used.
In programming, you need attention to details.

My reply didn't use datetime.datetime.now(), it used
datetime.datetime.utcnow().

datetime.datetime.now() gives the local time (local to the system on
which it is running).

datetime.datetime.utcnow() gives the UTC (GMT) time, which is the same
everywhere.

The line should be this:

date = (datetime.datetime.utcnow() + datetime.timedelta(hours=8)
).strftime('%Y-%m-%d %H:%M:%S')

I've also used '%Y' instead of '%y' because I prefer 4 digits for the year.
 
P

pandora.koura

Τη ΚυÏιακή, 16 ΣεπτεμβÏίου 2012 6:30:15 μ.μ. UTC+3, ο χÏήστης MRAB έγÏαψε:
On 2012-09-16 09:25, Îικόλαος ΚοÏÏας wrote:

[snip]
date = ( datetime.datetime.now() + datetime.timedelta(hours=8) ).strftime( '%y-%m-%d %H:%M:%S')

but iam giving +8 hours which is the time difference between texas, us where the server sits and Greece's time.

cant we somehow tell it to use GMT+2 ?

also it would be nice if datetime.datetime.now(GMT+2) can be used.

In programming, you need attention to details.



My reply didn't use datetime.datetime.now(), it used

datetime.datetime.utcnow().



datetime.datetime.now() gives the local time (local to the system on

which it is running).



datetime.datetime.utcnow() gives the UTC (GMT) time, which is the same

everywhere.



The line should be this:



date = (datetime.datetime.utcnow() + datetime.timedelta(hours=8)

).strftime('%Y-%m-%d %H:%M:%S')



I've also used '%Y' instead of '%y' because I prefer 4 digits for the year.

Cant it be written more easily as:
date = (datetime.datetime.utcnow(+2)

i know this is not thhe correct syntax but it just needs a way to add GMT+2hours since utc=gmt
 
P

pandora.koura

Τη ΚυÏιακή, 16 ΣεπτεμβÏίου 2012 6:30:15 μ.μ. UTC+3, ο χÏήστης MRAB έγÏαψε:
On 2012-09-16 09:25, Îικόλαος ΚοÏÏας wrote:

[snip]
date = ( datetime.datetime.now() + datetime.timedelta(hours=8) ).strftime( '%y-%m-%d %H:%M:%S')

but iam giving +8 hours which is the time difference between texas, us where the server sits and Greece's time.

cant we somehow tell it to use GMT+2 ?

also it would be nice if datetime.datetime.now(GMT+2) can be used.

In programming, you need attention to details.



My reply didn't use datetime.datetime.now(), it used

datetime.datetime.utcnow().



datetime.datetime.now() gives the local time (local to the system on

which it is running).



datetime.datetime.utcnow() gives the UTC (GMT) time, which is the same

everywhere.



The line should be this:



date = (datetime.datetime.utcnow() + datetime.timedelta(hours=8)

).strftime('%Y-%m-%d %H:%M:%S')



I've also used '%Y' instead of '%y' because I prefer 4 digits for the year.

Cant it be written more easily as:
date = (datetime.datetime.utcnow(+2)

i know this is not thhe correct syntax but it just needs a way to add GMT+2hours since utc=gmt
 
P

pandora.koura

Τη ΚυÏιακή, 16 ΣεπτεμβÏίου 2012 4:18:50 μ.μ. UTC+3, ο χÏήστης Ben Finney έγÏαψε:
It is becoming quite clear that some change has happened recently to

Google Groups that makes posts coming from there rather more obnoxious

than before. And there doesn't seem to be much its users can do except

use something else.



Using Google Groups for posting to Usenet has been a bad idea for a long

time, but now it just seems to be a sure recipe for annoying the rest of

us. Again, not something you have much control over, except to stop

using Google Groups.



--

\ “Actually I made up the term “object-orientedâ€, and I can tell |

`\ you I did not have C++ in mind.†—Alan Kay, creator of |

_o__) Smalltalk, at OOPSLA 1997 |

Ben Finney


If i ditch google groups what application can i use in Windows 8 to post tothis newsgroup and what newsserver too?
 
P

pandora.koura

Τη ΚυÏιακή, 16 ΣεπτεμβÏίου 2012 4:23:02 μ.μ. UTC+3, ο χÏήστης Günther Dietrich έγÏαψε:
[...]


also it would be nice if datetime.datetime.now(GMT+2) can be used.



In <one of

the first answers to your question you were pointed to pytz. This module

does exactly what you ask for:





If you do a help(pytz), obviously after having imported pytz, you will

get some information about the module. At the end of this help, there

are some attributes listed. One of them is all_timezones. Guess what it

contains?







Best regards,



Günther









PS: I didn't know pytz yet. But it took me just five minutes of reading

the datetime documentation and trying pytz.timezone(), to get a working

example.

So I don't understand, why you didn't follow the proposal of trying

pytz, but claimed, it wouldn't work.

Can you explain, why ist doesn't work for you rsp. what is the error

when it doesn't work?

import pytz fails in my webhost unfortunately :(
This module is not supported by hostgator.
 
P

pandora.koura

Whaen i tried to post just now by hitting sumbit, google groups told me that the following addresssed has benn found in this thread! i guess is used them all to notify everything!

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
 
C

Chris Angelico

Cant it be written more easily as:
date = (datetime.datetime.utcnow(+2)

i know this is not thhe correct syntax but it just needs a way to add GMT+2 hours since utc=gmt

I've dithered about whether to open this can of worms or let sleeping
dogs lie, and I finally decided to make some metaphor potpourri.

Simple UTC offsets are not the same thing as local time. There are a
variety of other considerations, but the main one is Daylight Robbery
Time, where every government wants to put its own stamp on things by
fiddling with the DST rules a bit. Most places will move their clocks
an hour forward for summer and then back for winter. But!

* Some places are sensible and don't have DST at all (eg
Australia/Queensland, America/Arizona)
* Northern hemisphere summer corresponds to southern hemisphere
winter, and vice versa
* Everyone has a different way of defining the boundaries of summer and winter
* And just to confuse us all, Irish Standard Time is used in summer,
and they *subtract* an hour for winter time!

The only way to handle timezones correctly and keep yourself even
marginally sane is to hand the job on to somebody else. I dodged the
whole issue by letting our Postgres database handle everything for us
(date/time formats, timezones, the lot), and having our internal
systems all just work in UTC. You'll likely find it easiest to do the
same thing with a Python library.

Just don't try to pretend to yourself that Greece uses GMT+2, because
it's not that simple. For one thing, it's currently summer there...

ChrisA
 
C

Chris Angelico

Whaen i tried to post just now by hitting sumbit, google groups told me that the following addresssed has benn found in this thread! i guess is used them all to notify everything!

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)

Ah. Did you then send to all three? Just a wild guess, but I'm
thinking that might be the cause of post duplication...

ChrisA
 
J

Joel Goldstick

Τη ΚυÏιακή, 16 ΣεπτεμβÏίου 2012 4:18:50 μ.μ. UTC+3, ο χÏήστης Ben FinneyέγÏαψε:


If i ditch google groups what application can i use in Windows 8 to post to this newsgroup and what newsserver too?

email client to (e-mail address removed)
 
P

pandora.koura

Ah. Did you then send to all three? Just a wild guess, but I'm

thinking that might be the cause of post duplication...



ChrisA

I had no choise, it doesnt let me pick one, it just notifies me that it will posted to these 3.
 
P

pandora.koura

Ah. Did you then send to all three? Just a wild guess, but I'm

thinking that might be the cause of post duplication...



ChrisA

I had no choise, it doesnt let me pick one, it just notifies me that it will posted to these 3.
 
P

pandora.koura

email client to (e-mail address removed)

wait a minute! i must use my ISP's news server and then post o comp.lang.python no?

What is (e-mail address removed) how can i post there?
 
P

pandora.koura

email client to (e-mail address removed)

wait a minute! i must use my ISP's news server and then post o comp.lang.python no?

What is (e-mail address removed) how can i post there?
 
G

Gene Heskett

Whaen i tried to post just now by hitting sumbit, google groups told me
that the following addresssed has benn found in this thread! i guess is
used them all to notify everything!

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)

Look, this googlegroups thing acting as a spam gateway has long since
gotten old. Whatever agent/program you are using must be a busted windows
application because it is not showing you the last line of every post that
comes through the list server which is:

<http://mail.python.org/mailman/listinfo/python-list>

There is, immediately above that line a '-- ' (note the space after, and
its always after a linefeed or carriage return so its the first character
of a line, and its code to all sane email agents that anything below it is
a signature and not to be copied into a reply. Windows email tends to clip
it off and a windows user will never see it! So that is why many of us
lament, in long strings of expletives, the brokenness of windows email
agents.

Subscribing to the mailing list is a 2 step process. First you click on
the above link and fill out the form and "submit" it.

That will, in a minute or so, cause an email to be sent to the address you
used in the form. You MUST reply to that message to confirm the
subscription. Whatever email agent you use from there is up to you, but
I'd suggest Thunderbird. I personally am partial to kmail, but then I'm
running linux on everything here, no M$ stuff allowed on the premises. Its
not open for discussion and has not been in 28 years since I discovered the
trs-80 color computer and an operating system for it called OS9.

Sorry folks, my rant for the day because of that gateway.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
Succumb to natural tendencies. Be hateful and boring.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top