[PHP] Time Problem: always ten past xx

2009-10-06 Thread Matthias Laug

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date  
and time.


So I get for example 10:30 and 06.10.2009. Standard german time  
format. Now I try to get the correct timestamp:


$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Jason
Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime 

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com] 
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date  
and time.

So I get for example 10:30 and 06.10.2009. Standard german time  
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Mert Oztekin
You also write the answer

var_dump(strftime(%d.%m.%Y %H:%m,$time));

there are 2 %m  you see? %m is month :)

for minute use %i


-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: Tuesday, October 06, 2009 10:53 AM
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve 
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve 
mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak 
?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz 
mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, 
b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar 
sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


Re: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Matthias Laug

argh, why do I always stick to the stupid questions :( sorry

Am 06.10.2009 um 10:03 schrieb Mert Oztekin:


You also write the answer

var_dump(strftime(%d.%m.%Y %H:%m,$time));

there are 2 %m  you see? %m is month :)

for minute use %i


-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: Tuesday, October 06, 2009 10:53 AM
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  
Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere  
özeldir ve gizlidir. Size yanlışlıkla ulaşmışsa lütfen  
gönderen kisiyi bilgilendiriniz ve mesajı sisteminizden siliniz.  
Mesaj ve eklerinin içeriği ile ilgili olarak şirketimizin herhangi  
bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz mesajın ve  
bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından,  
bütünlüğünün ve gizliliğinin korunamamasından, virüs  
içermesinden ve bilgisayar sisteminize verebileceği herhangi bir  
zarardan sorumlu tutulamaz.


This message and attachments are confidential and intended for the  
individual(s) stated in this message. If you received this message  
in error, please immediately notify the sender and delete it from  
your system. Our company has no legal responsibility for the  
contents of the message and its attachments. Our company shall have  
no liability for any changes or late receiving, loss of integrity  
and confidentiality, viruses and any damages caused in anyway to  
your computer system.


Matthias Laug
Schillerstraße 36
10627 Berlin

Tel.: 0176 / 20 14 21 63
eMail: matthias.l...@gmail.com





RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Mert Oztekin
Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January 
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-Original Message-
From: Jason [mailto:networkad...@emarket2.com]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve 
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve 
mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak 
?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz 
mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, 
b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar 
sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Mert Oztekin
My mistake,

I thought it was date() now strftime()
Sorry

(why do php developers create two different standarts for such similiar 
functions???☺ )

_
From: Mert Oztekin
Sent: Tuesday, October 06, 2009 11:07 AM
To: 'Jason'; 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx


Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January 
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-Original Message-
From: Jason [mailto:networkad...@emarket2.com]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve 
gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz ve 
mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak 
şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz 
mesajın ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, 
bütünlüğünün ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar 
sisteminize verebileceği herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


RE: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Jason
Hi Mert,

But we're not talking about date() here, we're talking strftime().

According to the manual %i doesn't do anything in strftime(). Closest match
is %I which is 12-hour format for hours.

HTH
J

-Original Message-
From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr] 
Sent: 06 October 2009 09:07
To: 'Jason'; 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Jason,

%M is also month:

Month --- ---
F A full textual representation of a month, such as January or March January
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31

Time --- ---
i Minutes with leading zeros 00 to 59

http://tr.php.net/manual/en/function.date.php



-Original Message-
From: Jason [mailto:networkad...@emarket2.com]
Sent: Tuesday, October 06, 2009 11:04 AM
To: 'Matthias Laug'; php-general@lists.php.net
Subject: RE: [PHP] Time Problem: always ten past xx

Hi,

That's because %m is month, what you need is %M for minute (note uppercase).

Check out http://php.net/strftime

HTH
J

-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem: always ten past xx

Hey everybody,

I've got a strange problem. Using PHP5.3 on my MacBook.

There is a script, which handles input from user, in this case a date
and time.

So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:

$time = strtotime(06.10.2009 10:30);
var_dump($time);
var_dump(strftime(%d.%m.%Y %H:%m,$time));

But the result is as

int 1254817800
string '06.10.2009 10:10' (length=16)

The minutes are always 10, no matter what time I get.

Anyone a clue?

Thanks, Mattes

P.S.: default timezone is set to

date_default_timezone_set('Europe/Berlin');



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz
ve mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili
olarak ?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r.
?irketimiz mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge?
ula?mas?ndan, b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s
i?ermesinden ve bilgisayar sisteminize verebilece?i herhangi bir zarardan
sorumlu tutulamaz.

This message and attachments are confidential and intended for the
individual(s) stated in this message. If you received this message in error,
please immediately notify the sender and delete it from your system. Our
company has no legal responsibility for the contents of the message and its
attachments. Our company shall have no liability for any changes or late
receiving, loss of integrity and confidentiality, viruses and any damages
caused in anyway to your computer system.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Problem: always ten past xx

2009-10-06 Thread Tom Worster
On 10/6/09 4:16 AM, Mert Oztekin mozte...@anadolusigorta.com.tr wrote:

 My mistake,
 
 I thought it was date() now strftime()
 Sorry
 
 (why do php developers create two different standarts for such similiar
 functions???☺ )
 

it's traditional to do so. it reminds me of the bit about subtly
incompatible shells in unix from Real Programmers Don't Use Pascal:

Even Unix might not be as bad on Real Programmers as it once was. The
latest release of Unix has the potential of an operating system worthy of
any Real Programmer-- two different and subtly incompatible user interfaces,
an arcane and complicated teletype driver, virtual memory. If you ignore the
fact that it's structured, even 'C' programming can be appreciated by the
Real Programmer: after all, there's no type checking, variable names are
seven (ten? eight?) characters long, and the added bonus of the Pointer data
type is thrown in-- like having the best parts of Fortran and assembly
language in one place. (Not to mention some of the more creative uses for
#define.)

we could collect a list:

gnu make vs bsd make
how many subtly different versions of grep are there?


but i'm, sure it's been done already and i guess it's off topic.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Time Problem: always ten past xx

2009-10-06 Thread tedd

At 10:07 AM +0200 10/6/09, Matthias Laug wrote:

argh, why do I always stick to the stupid questions :( sorry


Because with the important questions, you don't need answers. You 
understand them.


Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php