FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Putting it all together
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Storing dates [message #186265 is a reply to message #186262] Sun, 22 June 2014 13:29 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 6/22/2014 4:03 AM, Erick T. Barkhuis wrote:
> Arno Welzel:
>
>> 1967-09-12 for the 9. September of 1967
>> BTW: This is why ISO 8601 had been invented
>
> If that's the case, I don't like ISO 8601.
>
>
>

Why not, Erick? It's a good format which sorts naturally.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
Re: Storing dates [message #186267 is a reply to message #186265] Sun, 22 June 2014 14:24 Go to previous messageGo to next message
Erick T. Barkhuis is currently offline  Erick T. Barkhuis
Messages: 5
Registered: May 2014
Karma: 0
Junior Member
Jerry Stuckle:

> On 6/22/2014 4:03 AM, Erick T. Barkhuis wrote:
>> Arno Welzel:
>>
>>> 1967-09-12 for the 9. September of 1967
>>> BTW: This is why ISO 8601 had been invented
>>
>> If that's the case, I don't like ISO 8601.
>
> Why not, Erick? It's a good format which sorts naturally.

But apparently, it wants date formats to be three days off!
It might sort naturally, but it's not accurate enough.


--
Erick
Re: Storing dates [message #186268 is a reply to message #186267] Sun, 22 June 2014 14:32 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 6/22/2014 10:24 AM, Erick T. Barkhuis wrote:
> Jerry Stuckle:
>
>> On 6/22/2014 4:03 AM, Erick T. Barkhuis wrote:
>>> Arno Welzel:
>>>
>>>> 1967-09-12 for the 9. September of 1967
>>>> BTW: This is why ISO 8601 had been invented
>>>
>>> If that's the case, I don't like ISO 8601.
>>
>> Why not, Erick? It's a good format which sorts naturally.
>
> But apparently, it wants date formats to be three days off!
> It might sort naturally, but it's not accurate enough.
>
>

No, "9" is September. The full date is September 12th, 1967. The
difference in languages and punctuation is causing confusion.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
Re: Storing dates [message #186269 is a reply to message #186268] Sun, 22 June 2014 14:45 Go to previous messageGo to next message
Erick T. Barkhuis is currently offline  Erick T. Barkhuis
Messages: 5
Registered: May 2014
Karma: 0
Junior Member
Jerry Stuckle:

> On 6/22/2014 10:24 AM, Erick T. Barkhuis wrote:
>> Jerry Stuckle:
>>
>>> On 6/22/2014 4:03 AM, Erick T. Barkhuis wrote:
>>>> Arno Welzel:
>>>>
>>>> > 1967-09-12 for the 9. September of 1967
>>>> > BTW: This is why ISO 8601 had been invented
>>>>
>>>> If that's the case, I don't like ISO 8601.
>>>
>>> Why not, Erick? It's a good format which sorts naturally.
>>
>> But apparently, it wants date formats to be three days off!
>> It might sort naturally, but it's not accurate enough.
>>
>>
>
> No, "9" is September. The full date is September 12th, 1967. The
> difference in languages and punctuation is causing confusion.

Obviously!
Arno is german. In Germany, it's common to write a dot as abbreviation
for 'st', 'nd', 'rd' and 'th':
He would pronounce "9. September" as "der neunte September" (the ninth
of September).

[Now that I have to explain this, it ain't funny anymore: Arno wrote
1967-09-12 and claimed this to be equal to the ninth of September 1967.
That prompted me, since I sometimes like to see funny things where they
aren't, to claim that ISO 8601 is no good at all, if it defines date
formats three days off]



--
Erick
Re: Storing dates [message #186270 is a reply to message #186262] Sun, 22 June 2014 14:47 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Erick T. Barkhuis, 2014-06-22 10:03:

> Arno Welzel:
>
>> 1967-09-12 for the 9. September of 1967
>> BTW: This is why ISO 8601 had been invented
>
> If that's the case, I don't like ISO 8601.

Of course it was just a typo and 1967-09-12 is for 12. September of 1967 ;-)


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186272 is a reply to message #186265] Sun, 22 June 2014 15:00 Go to previous messageGo to next message
gordonb.q26od is currently offline  gordonb.q26od
Messages: 1
Registered: June 2014
Karma: 0
Junior Member
>>> 1967-09-12 for the 9. September of 1967
>>> BTW: This is why ISO 8601 had been invented

>> If that's the case, I don't like ISO 8601.

> Why not, Erick? It's a good format which sorts naturally.

Read the numbers very, very carefully.
Re: Storing dates [message #186273 is a reply to message #186267] Sun, 22 June 2014 15:26 Go to previous messageGo to next message
Jrgen Exner is currently offline  Jrgen Exner
Messages: 14
Registered: March 2013
Karma: 0
Junior Member
On 22 Jun 2014 14:24:12 GMT, "Erick T. Barkhuis"
<erick(dot)use-net(at)ardane(dot)c(dot)o(dot)m> wrote in comp.databases.mysql:
>>>> 1967-09-12 for the 9. September of 1967
>
> But apparently, it wants date formats to be three days off!

:-)

Good one!!!

jue
Re: Storing dates [message #186274 is a reply to message #186270] Sun, 22 June 2014 17:55 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Sun, 22 Jun 2014 16:47:36 +0200, Arno Welzel wrote:

> Erick T. Barkhuis, 2014-06-22 10:03:
>
>> Arno Welzel:
>>
>>> 1967-09-12 for the 9. September of 1967
>>> BTW: This is why ISO 8601 had been invented
>>
>> If that's the case, I don't like ISO 8601.
>
> Of course it was just a typo and 1967-09-12 is for 12. September of 1967 ;-)

But how are us humans supposed to know which comes first?
what if you see 1967-31-09?
if it read 1967-Sep-09 then there is no guessing is there?
Re: Storing dates [message #186275 is a reply to message #186261] Sun, 22 June 2014 18:05 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Sun, 22 Jun 2014 08:53:17 +0200, Arno Welzel wrote:

> richard, 2014-06-21 20:28:
>
>> On Sat, 21 Jun 2014 17:42:29 +0000 (UTC), Doug Miller wrote:
>>
>>> richard <noreply(at)example(dot)com> wrote in news:1mddkhwt2mr0v$.1m6eithcu7iod.dlg@
>>> 40tude.net:
>>>
>>>> As for the date usage on MY database tables, I am only using a date as a
>>>> reference.
>>>
>>> Patently false, as you have posted questions here asking for help resolving your problems in
>>> sorting by the date.
>>>
>>>> I really don't give a damn what your philosophy or ideals are
>>>> behind the so called "proper ways" of obtaining a date.
>>>
>>> Which is exactly *why* you have problems sorting by the date.
>>
>> The problem with sorting is, it treats any value given as a string, then
>> determines which has the lowest value in total.
>> 1
>> 2
>> 3
>> 10
>> 20
>> 30
>> 100
>> 200
>> 300
>
> That's why *thinking* about how to store information is important.
>
> Even if you don't like to use a date datatype you should store the date
> values in a way that they can be used for sorting - so year first, then
> month, then day and all with leading zeros:
>
> 2014-06-22 for the 22. June of 2014
> 1967-09-12 for the 9. September of 1967
>
> and so on.
>
> BTW: This is why ISO 8601 had been invented - see
> <http://en.wikipedia.org/wiki/ISO_8601>.

Doesn't matter anymore. I am using the numeric day system instead.
where $date=date(z).
Re: Storing dates [message #186276 is a reply to message #186274] Sun, 22 June 2014 19:31 Go to previous messageGo to next message
Jrgen Exner is currently offline  Jrgen Exner
Messages: 14
Registered: March 2013
Karma: 0
Junior Member
On Sun, 22 Jun 2014 13:55:49 -0400, richard <noreply(at)example(dot)com> wrote
in comp.databases.mysql:
>>>> BTW: This is why ISO 8601 had been invented
>> Of course it was just a typo and 1967-09-12 is for 12. September of 1967 ;-)
>
> But how are us humans supposed to know which comes first?

Simple: because it is unambiguously defined in ISO 8601.

> what if you see 1967-31-09?

Then you are not seeing a valid date in ISO-8601 format.

> if it read 1967-Sep-09 then there is no guessing is there?

Yes there is, because in many languages "Sep" doesn't make any sense.
Furthermore obviously dates in that format cannot be sorted easily.

jue
Re: Storing dates [message #186277 is a reply to message #186268] Sun, 22 June 2014 19:44 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Sun, 22 Jun 2014 10:32:09 -0400, Jerry Stuckle wrote:

> On 6/22/2014 10:24 AM, Erick T. Barkhuis wrote:
>> Jerry Stuckle:
>>
>>> On 6/22/2014 4:03 AM, Erick T. Barkhuis wrote:
>>>> Arno Welzel:
>>>>
>>>> > 1967-09-12 for the 9. September of 1967 BTW: This is why ISO 8601
>>>> > had been invented
>>>>
>>>> If that's the case, I don't like ISO 8601.
>>>
>>> Why not, Erick? It's a good format which sorts naturally.
>>
>> But apparently, it wants date formats to be three days off!
>> It might sort naturally, but it's not accurate enough.

> No, "9" is September. The full date is September 12th, 1967. The
> difference in languages and punctuation is causing confusion.

Yes Jerry, but Arno wrote:

1967-09-12 for the 9. September of 1967

Which is the iso 8601 representation of 12th sep 1967 followed by the
text representation of 9th sep 1967.

i.e. Arno made a booboo!

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
Re: Storing dates [message #186278 is a reply to message #186274] Sun, 22 June 2014 19:52 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Sun, 22 Jun 2014 13:55:49 -0400, richard wrote:

> On Sun, 22 Jun 2014 16:47:36 +0200, Arno Welzel wrote:
>
>> Erick T. Barkhuis, 2014-06-22 10:03:
>>
>>> Arno Welzel:
>>>
>>>> 1967-09-12 for the 9. September of 1967 BTW: This is why ISO 8601 had
>>>> been invented
>>>
>>> If that's the case, I don't like ISO 8601.
>>
>> Of course it was just a typo and 1967-09-12 is for 12. September of
>> 1967 ;-)
>
> But how are us humans supposed to know which comes first? what if you
> see 1967-31-09?

If you know it's an iso 8601 date then you know that the first 4 digits
(1967) are the year, the next 2 digits (31) are the month and the last 2
digits (09) are the day number.

> if it read 1967-Sep-09 then there is no guessing is there?

1967-sep-09 is not an iso 8601 date.

Iso 8601 defines a date as:

[4 digit Year Number][-][2 digit Month Number][-][2 digit Day Number]

So if "1967-31-09" was valid in iso 8601 it would actually be
"1969-07-09" or the 9th of July 1969, because July 1969 is the 31st month
starting at January 1967.

The reason iso 8601 is good is that in the string form, iso 8601 dates
sort properly, ie ascending / descending string order is also ascending /
descending date order. If you don't understand this, you obviously don't
understand anything about string sorting either.

Oh right. You don't.

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
Re: Storing dates [message #186279 is a reply to message #186274] Sun, 22 June 2014 19:52 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
richard, 2014-06-22 19:55:

> On Sun, 22 Jun 2014 16:47:36 +0200, Arno Welzel wrote:
>
>> Erick T. Barkhuis, 2014-06-22 10:03:
>>
>>> Arno Welzel:
>>>
>>>> 1967-09-12 for the 9. September of 1967
>>>> BTW: This is why ISO 8601 had been invented
>>>
>>> If that's the case, I don't like ISO 8601.
>>
>> Of course it was just a typo and 1967-09-12 is for 12. September of 1967 ;-)
>
> But how are us humans supposed to know which comes first?

They look what ISO 8601 defines.

> what if you see 1967-31-09?

This is an invalid date according to ISO 8601.

> if it read 1967-Sep-09 then there is no guessing is there?

This is also an invalid date according to ISO 8601.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186280 is a reply to message #186275] Sun, 22 June 2014 19:56 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
richard, 2014-06-22 20:05:

> On Sun, 22 Jun 2014 08:53:17 +0200, Arno Welzel wrote:
>
[about date storage in databases]
>> BTW: This is why ISO 8601 had been invented - see
>> <http://en.wikipedia.org/wiki/ISO_8601>.
>
> Doesn't matter anymore. I am using the numeric day system instead.
> where $date=date(z).

Really? Literally "where $date=date(z)"? Looks very unusual.

And even if this would make any sense - it least in MySQL date() is
*not* a "numeric day system":

< http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#functio n_date>

Or did you switch to another database system?


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186281 is a reply to message #186275] Sun, 22 June 2014 22:30 Go to previous messageGo to next message
Jrgen Exner is currently offline  Jrgen Exner
Messages: 14
Registered: March 2013
Karma: 0
Junior Member
On Sun, 22 Jun 2014 14:05:40 -0400, richard <noreply(at)example(dot)com> wrote
in comp.databases.mysql:
> Doesn't matter anymore. I am using the numeric day system

Now, what on earth is a "numeric day system"? Earlier you claimed you
were using the Julian calender. Now, what is it?
Mind to make up your mind?

jue
Re: Storing dates [message #186284 is a reply to message #186281] Mon, 23 June 2014 01:10 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
On Sun, 22 Jun 2014 15:30:48 -0700, Jürgen Exner wrote:
> On Sun, 22 Jun 2014 14:05:40 -0400, richard <noreply(at)example(dot)com> wrote
> in comp.databases.mysql:
>> Doesn't matter anymore. I am using the numeric day system
>
> Now, what on earth is a "numeric day system"? Earlier you claimed you
> were using the Julian calender. Now, what is it?

Nah, he didn't say he was using Julian; he was just throwing up a dummy
argument against using actual DATE columns. Half of his proposals and
criteria are shit-arguments that exist only to provide inconvenient
circumstances.

--
"25 grams of wafers and 20 ml of wine undergo transubstantiation and
become the flesh and blood of our Lord. How many Joules of heat are
released by the transformation?" --Theological Physics exam, 1997
Re: Storing dates [message #186285 is a reply to message #186280] Mon, 23 June 2014 02:46 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Sun, 22 Jun 2014 21:56:57 +0200, Arno Welzel wrote:

> richard, 2014-06-22 20:05:
>
>> On Sun, 22 Jun 2014 08:53:17 +0200, Arno Welzel wrote:
>>
> [about date storage in databases]
>>> BTW: This is why ISO 8601 had been invented - see
>>> <http://en.wikipedia.org/wiki/ISO_8601>.
>>
>> Doesn't matter anymore. I am using the numeric day system instead.
>> where $date=date(z).
>
> Really? Literally "where $date=date(z)"? Looks very unusual.
>
> And even if this would make any sense - it least in MySQL date() is
> *not* a "numeric day system":
>
> < http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#functio n_date>
>
> Or did you switch to another database system?

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

Day --- ---
d Day of the month, 2 digits with leading zeros 01 to 31
D A textual representation of a day, three letters Mon through Sun
j Day of the month without leading zeros 1 to 31
l (lowercase 'L') A full textual representation of the day of the week
Sunday through Saturday
N ISO-8601 numeric representation of the day of the week (added in PHP
5.1.0) 1 (for Monday) through 7 (for Sunday)
S English ordinal suffix for the day of the month, 2 characters st, nd,
rd or th. Works well with j
w Numeric representation of the day of the week 0 (for Sunday) through 6
(for Saturday)
z The day of the year (starting from 0) 0 through 365

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#functio n_dayofyear

dayofyear() can now be used to convert back to calendar format.
Re: Storing dates [message #186286 is a reply to message #186280] Mon, 23 June 2014 03:04 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Sun, 22 Jun 2014 21:56:57 +0200, Arno Welzel wrote:

> richard, 2014-06-22 20:05:
>
>> On Sun, 22 Jun 2014 08:53:17 +0200, Arno Welzel wrote:
>>
> [about date storage in databases]
>>> BTW: This is why ISO 8601 had been invented - see
>>> <http://en.wikipedia.org/wiki/ISO_8601>.
>>
>> Doesn't matter anymore. I am using the numeric day system instead.
>> where $date=date(z).
>
> Really? Literally "where $date=date(z)"? Looks very unusual.
>
> And even if this would make any sense - it least in MySQL date() is
> *not* a "numeric day system":
>
> < http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#functio n_date>
>
> Or did you switch to another database system?

BTW, date() itself is not anything but a function.
date(z) takes the current date of the server and trasnform it into a number
in the range of 1 to 366.

If the date were 2014-01-01, date(z) would return 1.
Dayofyear() takes that number and transform it back to the calendar date.

In my use of "where", I meant that as "an example", not as used by mysql
select from where stuff.
Re: Storing dates [message #186292 is a reply to message #186285] Mon, 23 June 2014 06:11 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
richard, 2014-06-23 04:46:

> On Sun, 22 Jun 2014 21:56:57 +0200, Arno Welzel wrote:
>
>> richard, 2014-06-22 20:05:
>>
>>> On Sun, 22 Jun 2014 08:53:17 +0200, Arno Welzel wrote:
>>>
>> [about date storage in databases]
>>>> BTW: This is why ISO 8601 had been invented - see
>>>> <http://en.wikipedia.org/wiki/ISO_8601>.
>>>
>>> Doesn't matter anymore. I am using the numeric day system instead.
>>> where $date=date(z).
>>
>> Really? Literally "where $date=date(z)"? Looks very unusual.
>>
>> And even if this would make any sense - it least in MySQL date() is
>> *not* a "numeric day system":
>>
>> < http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#functio n_date>

This does still not explain, why you use "where $date=date(z)". PHP
itself does not execute SQL statements.



--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186293 is a reply to message #186286] Mon, 23 June 2014 06:12 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
richard, 2014-06-23 05:04:

[...]
> BTW, date() itself is not anything but a function.
> date(z) takes the current date of the server and trasnform it into a number
> in the range of 1 to 366.
>
> If the date were 2014-01-01, date(z) would return 1.
> Dayofyear() takes that number and transform it back to the calendar date.

Yep - but only for the current year. Next year 1 would meen 2015-01-01
and so on.



--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186295 is a reply to message #186292] Mon, 23 June 2014 06:37 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Mon, 23 Jun 2014 08:11:46 +0200, Arno Welzel wrote:

> richard, 2014-06-23 04:46:
>
>> On Sun, 22 Jun 2014 21:56:57 +0200, Arno Welzel wrote:
>>
>>> richard, 2014-06-22 20:05:
>>>
>>>> On Sun, 22 Jun 2014 08:53:17 +0200, Arno Welzel wrote:
>>>>
>>> [about date storage in databases]
>>>> > BTW: This is why ISO 8601 had been invented - see
>>>> > <http://en.wikipedia.org/wiki/ISO_8601>.
>>>>
>>>> Doesn't matter anymore. I am using the numeric day system instead.
>>>> where $date=date(z).
>>>
>>> Really? Literally "where $date=date(z)"? Looks very unusual.
>>>
>>> And even if this would make any sense - it least in MySQL date() is
>>> *not* a "numeric day system":
>>>
>>> < http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#functio n_date>
>
> This does still not explain, why you use "where $date=date(z)". PHP
> itself does not execute SQL statements.

Look dunbshit, I am not using "where" here as an sql statement or property.

for instance you see something like mm-dd-yy then the writer says, "Where
m=month, d=day, and y=year".
"Where" is used routinely to define what the writer meant by his
abbreviations and such.

No Mr. Miller, I am not apologizing to him or you.
He's just being an irritating troll now.
Re: Storing dates [message #186296 is a reply to message #186293] Mon, 23 June 2014 06:45 Go to previous messageGo to next message
Geoff Muldoon is currently offline  Geoff Muldoon
Messages: 19
Registered: July 2011
Karma: 0
Junior Member
In article <53A7C563(dot)6050901(at)arnowelzel(dot)de>, usenet(at)arnowelzel(dot)de
says...
>
> richard, 2014-06-23 05:04:
>
> [...]
>> BTW, date() itself is not anything but a function.
>> date(z) takes the current date of the server and trasnform it into a number
>> in the range of 1 to 366.
>>
>> If the date were 2014-01-01, date(z) would return 1.
>> Dayofyear() takes that number and transform it back to the calendar date.
>
> Yep - but only for the current year. Next year 1 would meen 2015-01-01
> and so on.

Doesn't the MySQL DATEOFYEAR() function actually take a DATE data type
input and return a number (in range 1-366)?

Unless of course Richard is talking about some weird non-mysql PHP
function he has cobbled together.

GM
Re: Storing dates [message #186297 is a reply to message #186295] Mon, 23 June 2014 09:10 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Am 2014-06-23 08:37, schrieb richard:

> Look dunbshit, [...]

Ok, welcome to my filter. My apologies that I did not ignore you earlier.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186298 is a reply to message #186296] Mon, 23 June 2014 11:58 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Mon, 23 Jun 2014 16:45:23 +1000, Geoff Muldoon wrote:

> In article <53A7C563(dot)6050901(at)arnowelzel(dot)de>, usenet(at)arnowelzel(dot)de
> says...
>>
>> richard, 2014-06-23 05:04:
>>
>> [...]
>>> BTW, date() itself is not anything but a function.
>>> date(z) takes the current date of the server and trasnform it into a number
>>> in the range of 1 to 366.
>>>
>>> If the date were 2014-01-01, date(z) would return 1.
>>> Dayofyear() takes that number and transform it back to the calendar date.
>>
>> Yep - but only for the current year. Next year 1 would meen 2015-01-01
>> and so on.
>
> Doesn't the MySQL DATEOFYEAR() function actually take a DATE data type
> input and return a number (in range 1-366)?
>
> Unless of course Richard is talking about some weird non-mysql PHP
> function he has cobbled together.
>
> GM

As I get told so frequently, RTFM asshole!
Re: Storing dates [message #186300 is a reply to message #186295] Mon, 23 June 2014 13:50 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Mon, 23 Jun 2014 02:37:14 -0400, richard <noreply(at)example(dot)com>
wrote:

> Look dunbshit, I am not using "where" here as an sql statement or property.

Wow, I hope Lew reconsiders his offer to help bullis now.

bullis, you better learn SQL and PHP REAL quick, because you're
alienating the entire group here.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: Storing dates [message #186302 is a reply to message #186300] Mon, 23 June 2014 15:13 Go to previous messageGo to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
On Mon, 23 Jun 2014 06:50:43 -0700, Evan Platt wrote:

> On Mon, 23 Jun 2014 02:37:14 -0400, richard <noreply(at)example(dot)com>
> wrote:
>
>> Look dunbshit, I am not using "where" here as an sql statement or property.
>
> Wow, I hope Lew reconsiders his offer to help bullis now.
>
> bullis, you better learn SQL and PHP REAL quick, because you're
> alienating the entire group here.

You certainly have helped on that.
Just because SQL or other lamguages use a common every day word in its
structure does not mean that is the only way that word can be used.
Arno took the context and wrongfully assumed that I was referring to the
use of "where" in the select statement.This is not what I was using the
word for.
And all you do is add agitation to it all purely for wanting to make things
worse than they are.
Re: Storing dates [message #186304 is a reply to message #186302] Mon, 23 June 2014 16:13 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Mon, 23 Jun 2014 11:13:23 -0400, richard <noreply(at)example(dot)com>
wrote:

>> bullis, you better learn SQL and PHP REAL quick, because you're
>> alienating the entire group here.
>
> You certainly have helped on that.

Take responsibility for your actions, bullis. You calling the regulars
here dumbshits, creating sock puppets when people refuse to help you,
and insulting everyone here means you are 100% responsible for
alienating people here.

> Just because SQL or other lamguages use a common every day word in its
> structure does not mean that is the only way that word can be used.
> Arno took the context and wrongfully assumed that I was referring to the
> use of "where" in the select statement.This is not what I was using the
> word for.

Oh. I misunderstood. In that case, you were fully justified in calling
Arno a dumbshit. </sarcasm>

> And all you do is add agitation to it all purely for wanting to make things
> worse than they are.

See my first paragraph. You can only blame yourself.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: Storing dates [message #186305 is a reply to message #186298] Mon, 23 June 2014 16:50 Go to previous messageGo to next message
Jrgen Exner is currently offline  Jrgen Exner
Messages: 14
Registered: March 2013
Karma: 0
Junior Member
On Mon, 23 Jun 2014 07:58:20 -0400, richard <noreply(at)example(dot)com> wrote
in comp.databases.mysql:
>>> richard, 2014-06-23 05:04:
>>>> BTW, date() itself is not anything but a function.
>>>> date(z) takes the current date of the server and trasnform it into a number
>>>> in the range of 1 to 366.
>>>> Dayofyear() takes that number and transform it back to the calendar date.
>
> As I get told so frequently, RTFM asshole!

I tried. But unfortunately I couldn't find said functions with said
functionality at
http://dev.mysql.com/doc/refman/5.7/en/language-structure.html

jue
Re: Storing dates [message #186306 is a reply to message #186305] Mon, 23 June 2014 17:02 Go to previous messageGo to next message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma: 0
Senior Member
Jürgen Exner wrote:

> On Mon, 23 Jun 2014 07:58:20 -0400, richard <noreply(at)example(dot)com> wrote
> in comp.databases.mysql:
>>>> richard, 2014-06-23 05:04:
>>>> > BTW, date() itself is not anything but a function.
>>>> > date(z) takes the current date of the server and trasnform it into a number
>>>> > in the range of 1 to 366.
>>>> > Dayofyear() takes that number and transform it back to the calendar date.
>>
>> As I get told so frequently, RTFM asshole!
>
> I tried. But unfortunately I couldn't find said functions with said
> functionality at
> http://dev.mysql.com/doc/refman/5.7/en/language-structure.html

richard is referring to PHP's date[1] function. This should correctly
be called with a string argument (not a constant, as written above), e.g.

date('z')

And, of course, PHP stuff shouldn't be discussed in
comp.databases.mysql, so xpost & fup2 comp.lang.php.

[1] <http://www.php.net/manual/en/function.date.php>

--
Christoph M. Becker
Re: Storing dates [message #186307 is a reply to message #186304] Mon, 23 June 2014 20:33 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Evan Platt, 2014-06-23 18:13:

> On Mon, 23 Jun 2014 11:13:23 -0400, richard <noreply(at)example(dot)com>
> wrote:
>
>>> bullis, you better learn SQL and PHP REAL quick, because you're
>>> alienating the entire group here.
>>
>> You certainly have helped on that.
>
> Take responsibility for your actions, bullis. You calling the regulars
> here dumbshits, creating sock puppets when people refuse to help you,
> and insulting everyone here means you are 100% responsible for
> alienating people here.

The best way to deal with such people is to ignore them and not to
produce more off-topic noise.

Thank you!


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de
Re: Storing dates [message #186308 is a reply to message #186298] Tue, 24 June 2014 02:00 Go to previous messageGo to next message
Geoff Muldoon is currently offline  Geoff Muldoon
Messages: 19
Registered: July 2011
Karma: 0
Junior Member
Richard noreply(at)example(dot)com says...

>>>> If the date were 2014-01-01, date(z) would return 1.
>>>> Dayofyear() takes that number and transform it back to the calendar date.

>> Doesn't the MySQL DATEOFYEAR() function actually take a DATE data
type
>> input and return a number (in range 1-366)?

> As I get told so frequently, RTFM asshole!

Do you mean this?
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-
functions.html#function_dayofyear

I can't find any in-built PHP function of that name, please post a link
to said manual entry. Arsehole.

GM
Re: Storing dates [message #186323 is a reply to message #186276] Tue, 24 June 2014 20:27 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
J�rgen Exner wrote:
^^^^^^^^^^^^
Unencoded non-ASCII characters in message headers are not allowed by
RFC 5536. Please fix your newsreader or switch to a working one.

> On Sun, 22 Jun 2014 13:55:49 -0400, richard <noreply(at)example(dot)com> wrote
> in comp.databases.mysql:

It's attribution *line*, _not_ attribution novel. Please adjust/fix your
newsreader or switch to one that allows you to not make life harder for your
readers.

>>>> > BTW: This is why ISO 8601 had been invented
>>> Of course it was just a typo and 1967-09-12 is for 12. September of 1967
>>> ;-)
>>
>> But how are us humans supposed to know which comes first?
>
> Simple: because it is unambiguously defined in ISO 8601.
^^^^^^^^^^^^^
Which is why …

>> what if you see 1967-31-09?
>
> Then you are not seeing a valid date in ISO-8601 format.

… that statement is wrong.

The ISO 8601 date format is unambiguously defined because it always has the
year number (Y), followed by the month number (M), optionally followed by
the day-of-month number (D): YYYY-MM-DD or YYYYMMDD. Whereas YYYY, YYYY-MM,
YY-MM-DD, and YYMMDD had been allowed, but the latter two were recommended
against and have been abolished in 2004 CE.

There is no YYYY-DD-MM format specified there, and since there are only 12
months in the Gregorian calendar, there cannot be a 31st.

<https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates>

F'up2 comp.lang.mysql

--
When all you know is jQuery, every problem looks $(olvable).
Re: Storing dates [message #186324 is a reply to message #186296] Tue, 24 June 2014 20:38 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Geoff Muldoon <geoff(dot)muldoon(at)trap(dot)gmail(dot)com> wrote:
^^^^^^^^^^^^^^
The “From” header field value must contain a proper e-mail address. I do
not think Google will take kindly on your misusing their namespace. Such
header field values are also expressly forbidden at albasani.net.

<http://www.interhack.net/pubs/munging-harmful/>
<http://albasani.net/info/terms_of_use.html.en>

> In article <53A7C563(dot)6050901(at)arnowelzel(dot)de>, usenet(at)arnowelzel(dot)de
> says...

It’s attribution *line*, _not_ attribution novel.

>> richard, 2014-06-23 05:04:
>> [...]
>>> BTW, date() itself is not anything but a function.
>>> date(z) takes the current date of the server and trasnform it into a
>>> number in the range of 1 to 366.
>>>
>>> If the date were 2014-01-01, date(z) would return 1.
>>> Dayofyear() takes that number and transform it back to the calendar
>>> date.
>>
>> Yep - but only for the current year. Next year 1 would meen 2015-01-01
>> and so on.
>
> Doesn't the MySQL DATEOFYEAR() function actually take a DATE data type
> input and return a number (in range 1-366)?

Yes, it does not; there is no such MySQL function. Probably you mean

< http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html#functio n_dayofyear>


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
Pages (2): [ «    1  2]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: str_replace does not like empty quotes
Next Topic: SplFileObject always returns an extra "last" line -- why?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 08:23:48 GMT 2024

Total time taken to generate the page: 0.02863 seconds