Another list of questions

Bonjour,

Many thanks to ARNO and Fil for their replies.

Now, I´ve been playing around with SPIP, and have some more questions:

1. How do I modify the displayed french date (e.g. mom_mois, mom_jour;
"JEUDI 12 JUILLET 2001") to correspond with the equivalent swedish
names?

2. Since I have my server on a US-location, I´ve to adjust the time
difference between US and Sweden. Where can I change this?

Best regards,
H.Kim

Hello,

On Friday 20 July 2001 00:31, Hi-Young Kim wrote:

1. How do I modify the displayed french date (e.g. mom_mois, mom_jour;
"JEUDI 12 JUILLET 2001") to correspond with the equivalent swedish
names?

2. Since I have my server on a US-location, I´ve to adjust the time
difference between US and Sweden. Where can I change this?

I think you can set up both, "simply" by defining your own PHP functions
in the file "mes_fonctions.php3" (please, note I'm also new to SPIP). Then
you can define your own filters, thus allowing you to display the date
according to your language and location.
There are PHP functions for this, have a look at the PHP doc.

Regards,

--
   .~. __________________________
   /V\ Linux / \ ___
  // \\ Power | Yves BAILLY | /" "\
/( )\ | kafka.fr@netcourrier.com | ( @ _ @ )
- ^^-^^ -------\__________________________/----oOO (_) OOo------
LUG Dijon : http://www.coagul.org

Yves BAILLY, le 20/07/01 9:41, a écrit :

I think you can set up both, "simply" by defining your own PHP functions
in the file "mes_fonctions.php3" (please, note I'm also new to SPIP). Then
you can define your own filters, thus allowing you to display the date
according to your language and location.
There are PHP functions for this, have a look at the PHP doc.

http://www.phpscripts-fr.net/download.php3?id=453
JM

Hello,

Thanks. Found an easier way by modifying inc_texte.php3. From what I can
see from the code, some preparations has been made for english date
formats?

I still have not solved the issue about correcting for time difference
between server location and client location (also a newbie on php), so
any suggestions will be much appreciated.

Regards,

H.Kim

-----Original Message-----
From: spip-admin@rezo.net [mailto:spip-admin@rezo.net] On
Behalf Of Yves BAILLY
Sent: den 20 juli 2001 09:42
To: spip@rezo.net
Subject: Re: [Spip] Another list of questions

Hello,

On Friday 20 July 2001 00:31, Hi-Young Kim wrote:

1. How do I modify the displayed french date (e.g.

mom_mois, mom_jour;

"JEUDI 12 JUILLET 2001") to correspond with the equivalent swedish
names?

2. Since I have my server on a US-location, I´ve to adjust the time
difference between US and Sweden. Where can I change this?

I think you can set up both, "simply" by defining your own
PHP functions in the file "mes_fonctions.php3" (please, note
I'm also new to SPIP). Then you can define your own filters,
thus allowing you to display the date according to your
language and location. There are PHP functions for this, have
a look at the PHP doc.

Regards,

--
  .~. __________________________
  /V\ Linux / \ ___
// \\ Power | Yves BAILLY | /" "\
/( )\ | kafka.fr@netcourrier.com | ( @ _ @ )
- ^^-^^ -------\__________________________/----oOO (_)
OOo------ LUG Dijon : http://www.coagul.org
_______________________________________________
spip mailing list
spip@rezo.net
http://listes.rezo.net/mailman/listinfo/spip

I still have not solved the issue about correcting for time difference
between server location and client location (also a newbie on php), so
any suggestions will be much appreciated.

As far as I know, this problem is very hard to resolve: the server doesn't know your own local time as a client.

The only way we could resolve this would be to use a Javascript once, so you get the clients local time, send it to the server, and compare it with the server local time.

But... even so, another _big_ problem would occur: this would have to be calculated for every client (or visitor) of the site. Because, of course, every visitor of the site would need it's own local time.

And even so, what would each webmaster prefer for it's own site:
- show (on the site) that a message has been sent at it's own local time (wich would be logical: if you're in Genoa-Italia right know, you want to date your message with the indication of local time, so that your testimony corresponds to the actual time of the event you discribe - "at noon the police shot a guy...");
- show the correspondance of time for the users local time (for an american visitor, would it be better to show that events occur at italian local time, or would it be better to indicate that it just happened in american time ("at five o'clock this morning, US West Coast time, the police shot...").

So... in anymay, the best thing is to save in the database with the servers local time. So that contributors all around the world would insert informations on the server with the same time schedule (after all, airline pilots work with absolute GMT times, wherever they are in the world). The SPIP system would then more easily order dates in an absolute manner (otherwise, an american contributor's message would seem to be posted before a european's contributor's message, if posted just a few hours later).

Then you can always add a special function to translate these dates to the clients local time, by combining javascript and PHP (eurk, that's always ugly...). Or a quite simple function adding or retrieving a certain number of hours so that the public site always shows time and date within your own time fuse (Stockholm?) for every visitor.

ARNO*

--
Le Scarabée : http://www.scarabee.com
uZine 2 : http://www.minirezo.net

DH/DSS, 0x11930F0B, DEEB 602D B344 644B AF88 BF73 85F4 2297 1193 0F0B

Hello, ARNO!

Merci de votre réponse!

I´m sorry if I was somewhat unclear in my request. What I meant was how
to set the shown time to reflect the time in Sweden instead of the
server time in US. Since most of our users will be from Sweden, this
will do. I think this is rather simple? Just add +6 hours... I just
don´t know where in the code I should make the changes.

Best regards,
H.Kim

-----Original Message-----
From: spip-admin@rezo.net [mailto:spip-admin@rezo.net] On
Behalf Of ARNO*
Sent: den 22 juli 2001 00:30
To: Hi-Young Kim; spip@rezo.net
Subject: RE: [Spip] Another list of questions

I still have not solved the issue about correcting for time

difference

between server location and client location (also a newbie

on php), so

any suggestions will be much appreciated.

As far as I know, this problem is very hard to resolve: the server
doesn't know your own local time as a client.

The only way we could resolve this would be to use a Javascript once,
so you get the clients local time, send it to the server, and compare
it with the server local time.

But... even so, another _big_ problem would occur: this would have to
be calculated for every client (or visitor) of the site. Because, of
course, every visitor of the site would need it's own local time.

And even so, what would each webmaster prefer for it's own site:
- show (on the site) that a message has been sent at it's own local
time (wich would be logical: if you're in Genoa-Italia right know,
you want to date your message with the indication of local time, so
that your testimony corresponds to the actual time of the event you
discribe - "at noon the police shot a guy...");
- show the correspondance of time for the users local time (for an
american visitor, would it be better to show that events occur at
italian local time, or would it be better to indicate that it just
happened in american time ("at five o'clock this morning, US West
Coast time, the police shot...").

So... in anymay, the best thing is to save in the database with the
servers local time. So that contributors all around the world would
insert informations on the server with the same time schedule (after
all, airline pilots work with absolute GMT times, wherever they are
in the world). The SPIP system would then more easily order dates in
an absolute manner (otherwise, an american contributor's message
would seem to be posted before a european's contributor's message, if
posted just a few hours later).

Then you can always add a special function to translate these dates
to the clients local time, by combining javascript and PHP (eurk,
that's always ugly...). Or a quite simple function adding or
retrieving a certain number of hours so that the public site always
shows time and date within your own time fuse (Stockholm?) for every
visitor.

ARNO*

--
Le Scarabée : http://www.scarabee.com
uZine 2 : http://www.minirezo.net

DH/DSS, 0x11930F0B, DEEB 602D B344 644B AF88 BF73 85F4 2297
1193 0F0B _______________________________________________
spip mailing list
spip@rezo.net
http://listes.rezo.net/mailman/listinfo/spip

Hello,

On Sunday 22 July 2001 08:59, Hi-Young Kim wrote:

I´m sorry if I was somewhat unclear in my request. What I meant was how
to set the shown time to reflect the time in Sweden instead of the
server time in US. Since most of our users will be from Sweden, this
will do. I think this is rather simple? Just add +6 hours... I just
don´t know where in the code I should make the changes.

Maybe (I haven't tested) this PHP functions might work :
to localize yourself :
http://www.php.net:8000/manual/en/html/function.setlocale.html
to build the date/time :
http://www.php.net:8000/manual/en/html/function.strftime.html

So, by calling setlocale() with the appropriate code, and then feeding
strftime() with a full timestamp (with time zone), you might be able
to give the *local* time anywher on Earth.

Hope this help.

--
   .~. __________________________
   /V\ Linux / \ ___
  // \\ Power | Yves BAILLY | /" "\
/( )\ | kafka.fr@netcourrier.com | ( @ _ @ )
- ^^-^^ -------\__________________________/----oOO (_) OOo------
LUG Dijon : http://www.coagul.org