date formats

[b][red]This message was edited by Moderator at 2003-9-9 5:3:57[/red][/b][hr]
I was looking on the VB board this morning and I came across a post that someone answered.

[code]
strNotes = Format(Now, "mm/dd/yyyy") & " " & txtNotes.Text
[/code]

I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?

The best would be yyyy/mm/dd

The reason why the American one pisses me off so much is because the company that I work at is British.. but maybe 6 years ago we opened places in NY and DA.. all the time there was problems with data input whete dates are concerned.

So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.




Comments

  • : [b][red]This message was edited by Moderator at 2003-9-9 5:3:57[/red][/b][hr]
    : I was looking on the VB board this morning and I came across a post that someone answered.
    :
    : [code]
    : strNotes = Format(Now, "mm/dd/yyyy") & " " & txtNotes.Text
    : [/code]
    :
    : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?
    :
    : The best would be yyyy/mm/dd
    :
    : The reason why the American one pisses me off so much is because the company that I work at is British.. but maybe 6 years ago we opened places in NY and DA.. all the time there was problems with data input whete dates are concerned.
    :
    : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.
    :
    :
    :
    :
    :

    Yes the format here is also ddmmyyyy . And yes it is causing a hell of
    a lot of problems . In ASP I have to set LCID=1033(If i remeber correctly) to get ddmmyyyy format .
    the safe way as you said, is to stick with yyyy/mm/dd format.

    So this format change is because of an argument ? Didn't know that .
    Could have saved us all a lot of work.



  • [b][red]This message was edited by lionb at 2003-9-9 5:53:20[/red][/b][hr]
    : : [b][red]This message was edited by Moderator at 2003-9-9 5:3:57[/red][/b][hr]
    : : I was looking on the VB board this morning and I came across a post that someone answered.
    : :
    : : [code]
    : : strNotes = Format(Now, "mm/dd/yyyy") & " " & txtNotes.Text
    : : [/code]
    : :
    : : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?
    : :
    : : The best would be yyyy/mm/dd
    : :
    : : The reason why the American one pisses me off so much is because the company that I work at is British.. but maybe 6 years ago we opened places in NY and DA.. all the time there was problems with data input whete dates are concerned.
    : :
    : : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.
    : :
    : :
    : :
    : :
    : :
    :
    : Yes the format here is also ddmmyyyy . And yes it is causing a hell of
    : a lot of problems . In ASP I have to set LCID=1033(If i remeber correctly) to get ddmmyyyy format .
    : the safe way as you said, is to stick with yyyy/mm/dd format.
    :
    : So this format change is because of an argument ? Didn't know that .
    : Could have saved us all a lot of work.
    :
    When I arrived to the US, I was very confusing with American date format. Now I am confusing with normal date format. I think US keep using different date format because of the same reason why they still do not use metric system. Wants to be different. As I know this "difference" causes a big problems for some American companies now who exports their products to different countries. Let's say Ford. This company builds cars for US and other countries. So they have to build the same car with different measurements. Besides they have to create different technical documentation, different tools and other things. All of that costs a lot of money. US government tries to teach people metric system but it does not work well because even teachers in school do not familiar well enough with this system


  • : [b][red]This message was edited by lionb at 2003-9-9 5:53:20[/red][/b][hr]
    : : : [b][red]This message was edited by Moderator at 2003-9-9 5:3:57[/red][/b][hr]
    : : : I was looking on the VB board this morning and I came across a post that someone answered.
    : : :
    : : : [code]
    : : : strNotes = Format(Now, "mm/dd/yyyy") & " " & txtNotes.Text
    : : : [/code]
    : : :
    : : : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?
    : : :
    : : : The best would be yyyy/mm/dd
    : : :
    : : : The reason why the American one pisses me off so much is because the company that I work at is British.. but maybe 6 years ago we opened places in NY and DA.. all the time there was problems with data input whete dates are concerned.
    : : :
    : : : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.
    : : :
    : : :
    : : :
    : : :
    : : :
    : :
    : : Yes the format here is also ddmmyyyy . And yes it is causing a hell of
    : : a lot of problems . In ASP I have to set LCID=1033(If i remeber correctly) to get ddmmyyyy format .
    : : the safe way as you said, is to stick with yyyy/mm/dd format.
    : :
    : : So this format change is because of an argument ? Didn't know that .
    : : Could have saved us all a lot of work.
    : :
    : When I arrived to the US, I was very confusing with American date format. Now I am confusing with normal date format. I think US keep using different date format because of the same reason why they still do not use metric system. Wants to be different. As I know this "difference" causes a big problems for some American companies now who exports their products to different countries. Let's say Ford. This company builds cars for US and other countries. So they have to build the same car with different measurements. Besides they have to create different technical documentation, different tools and other things. All of that costs a lot of money. US government tries to teach people metric system but it does not work well because even teachers in school do not familiar well enough with this system
    :

    Metric. Everything here is metric except road signs.. they are still in miles. Also I was taught metric at primary school. I have no idea what a yard is etc.

    Flakes.. on the date thing. We always format everything

    dd-mmm-yyyy .. no one can get confused then.


  • we use dd-mm-yyyy but when im programming, i prefer to use a timestamp. U know, seconds since epoch (1-1-1970 ??) You will never have problems with date format anymore if you use the timestamp as base to display the date in the right format.


    : [b][red]This message was edited by Moderator at 2003-9-9 5:3:57[/red][/b][hr]
    : I was looking on the VB board this morning and I came across a post that someone answered.
    :
    : [code]
    : strNotes = Format(Now, "mm/dd/yyyy") & " " & txtNotes.Text
    : [/code]
    :
    : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?
    :
    : The best would be yyyy/mm/dd
    :
    : The reason why the American one pisses me off so much is because the company that I work at is British.. but maybe 6 years ago we opened places in NY and DA.. all the time there was problems with data input whete dates are concerned.
    :
    : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.
    :
    :
    :
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://space.servehttp.com (ssh,ftp,http,stmp,imap etc etc)

  • yes, i use timestamp too on INSERT. but displaing it.. we change it.

    : we use dd-mm-yyyy but when im programming, i prefer to use a timestamp. U know, seconds since epoch (1-1-1970 ??) You will never have problems with date format anymore if you use the timestamp as base to display the date in the right format.
    :
    :
    : : [b][red]This message was edited by Moderator at 2003-9-9 5:3:57[/red][/b][hr]
    : : I was looking on the VB board this morning and I came across a post that someone answered.
    : :
    : : [code]
    : : strNotes = Format(Now, "mm/dd/yyyy") & " " & txtNotes.Text
    : : [/code]
    : :
    : : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?
    : :
    : : The best would be yyyy/mm/dd
    : :
    : : The reason why the American one pisses me off so much is because the company that I work at is British.. but maybe 6 years ago we opened places in NY and DA.. all the time there was problems with data input whete dates are concerned.
    : :
    : : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.
    : :
    : :
    : :
    : :
    : :
    :
    : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : url--> http://space.servehttp.com (ssh,ftp,http,stmp,imap etc etc)
    :
    :

  • : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?

    I used to figure it was because the "natural" way to read it was like "September 10th, 2003" so therefore it made sense to put the month first. I can understand dd/mm/yyyy from a "most-to-least precision" standpoint, but going back to my previous reasoning, "10th of September, 2003" seems clunky. This probably has nothing to do with it, but it's an idea I came up with when I was younger.

    : The best would be yyyy/mm/dd

    A while back I came up with an idea for a new calendar system based on the Vernal Equinox. The first day of the year would be the Vernal Equinox (approximately March 21). There would be no months, only seasons. So Spring would last until the Summer Solstice. Summer would last until the Autumnal Equinox, Autumn would last until the Winter Solstice, and Winter would last until the Vernal Equinox. That's basically how the "official" seasons work now anyways. An even better idea would be to use the midpoints as delimiters (so, for example, the Summer Solstice would be the exact middle of summer, etc), but I doubt the Christians of the world would be happy basing their calendar on days used for ancient pagan celebrations. In the first example, Christmas would be on "Winter 4th".

    : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.

    That's supposedly also why we took the English measurement system in the first place. Nowadays it hangs on because of mental inertia.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : Flakes.. on the date thing. We always format everything
    : dd-mmm-yyyy .. no one can get confused then.

    That's the standard date format for Oracle databases. Oracle dates are bizarre creatures. I think they're actually an odd subtype of Strings rather than numbers.

    In a previous job I worked on a system that was using Informix to replace an aging COBOL/Oracle system. One of the tables had a column named "consortium_nbr". For reasons lost to history, this table actually stored a date value. When the Oracle data was exported, the DD-MMM-YY dates didn't convert automatically and the DBA didn't bother to take care of it, so they were loaded into the new schema as strings. So we had a column named "nbr" which was a string datatype that stored dates. Oy.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : : I know that mm/dd/ is used in America. But why? Surely in terms of sequences its not the logical way. UK uses dd/mm.. and maybe India too?
    :
    : I used to figure it was because the "natural" way to read it was like "September 10th, 2003" so therefore it made sense to put the month first. I can understand dd/mm/yyyy from a "most-to-least precision" standpoint, but going back to my previous reasoning, "10th of September, 2003" seems clunky. This probably has nothing to do with it, but it's an idea I came up with when I was younger.

    [blue]
    If I was taking about my birthday I would say. "The 11th of May" Not "May 11" Seems too short for me. Ive never heard anyone here say MM/DD Except when making reference to 09/11 in parliament. Actually some back bench MP called it the 9th of September recently. The Fool.
    [/blue]

    They (Influential Americans) swapped the date format.. if I remember it was to screw up the post service between UK and US. I think something probably did not get done. If I have time I will read about this again.

    :
    : : The best would be yyyy/mm/dd
    :
    : A while back I came up with an idea for a new calendar system based on the Vernal Equinox. The first day of the year would be the Vernal Equinox (approximately March 21). There would be no months, only seasons. So Spring would last until the Summer Solstice. Summer would last until the Autumnal Equinox, Autumn would last until the Winter Solstice, and Winter would last until the Vernal Equinox. That's basically how the "official" seasons work now anyways. An even better idea would be to use the midpoints as delimiters (so, for example, the Summer Solstice would be the exact middle of summer, etc), but I doubt the Christians of the world would be happy basing their calendar on days used for ancient pagan celebrations. In the first example, Christmas would be on "Winter 4th".
    :
    : : So I did some research... Some argument before the independance.. but I think its kind of like cutting your nose off to spite your face.
    :
    : That's supposedly also why we took the English measurement system in the first place. Nowadays it hangs on because of mental inertia.
    :
    [blue]
    At that time... what alternative was there? Even now theres still people that use Imperial. Slowly they are being forced to change. EU has banned shops from displaying Imperial measurments on food. However I think the Mile is staying. Just the cost alone on the road signs would cost a bomb.
    [/blue]
  • : : Flakes.. on the date thing. We always format everything
    : : dd-mmm-yyyy .. no one can get confused then.
    :
    : That's the standard date format for Oracle databases. Oracle dates are bizarre creatures. I think they're actually an odd subtype of Strings rather than numbers.
    :
    : In a previous job I worked on a system that was using Informix to replace an aging COBOL/Oracle system. One of the tables had a column named "consortium_nbr". For reasons lost to history, this table actually stored a date value. When the Oracle data was exported, the DD-MMM-YY dates didn't convert automatically and the DBA didn't bother to take care of it, so they were loaded into the new schema as strings. So we had a column named "nbr" which was a string datatype that stored dates. Oy.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    Interesting. I wonder why they don't just use numbers? Surely it would be much easier to to write yyyymmdd code for a database engine?





  • : Interesting. I wonder why they don't just use numbers? Surely it would be much easier to to write yyyymmdd code for a database engine?

    You'd think it would be easy to pass boolean values in and out of an Oracle (they are, after all, working on version 10 now) stored procedures, but NOOOOOOOOOOOOOOOO.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : : Interesting. I wonder why they don't just use numbers? Surely it would be much easier to to write yyyymmdd code for a database engine?
    :
    : You'd think it would be easy to pass boolean values in and out of an Oracle (they are, after all, working on version 10 now) stored procedures, but NOOOOOOOOOOOOOOOO.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :


    I am working with oracle now. And haven't had to use a boolean field.
    But I sort of like Oracle,it has an elegant look to it ,at least for me.
    Had worked with SQLServer and is still working with Access .
    I had read somewhere that dates are stored as seconds-elapsed-since-a-preset-date in the DB ,I think the Documentation was for SQLServer .
    Don't know hoe it is for Oracle.
    One other difference I see is that you can't use
    "Select top 10 * from table order by order by somefield" in Oracle.But I also read that you can do this,but the order by is after the selection . I must be doing it the wrong way.

    Haven't experimented too much these days . Maybe I should.

  • : I am working with oracle now. And haven't had to use a boolean field.

    That's another thing, you can't use booleans as table fields, only PL/SQL variables.

    : But I sort of like Oracle,it has an elegant look to it ,at least for me.
    : Had worked with SQLServer and is still working with Access .

    Yeah, it does have some very cool features, but some little things really annoy me.

    : One other difference I see is that you can't use
    : "Select top 10 * from table order by order by somefield" in Oracle.But I also read that you can do this,but the order by is after the selection . I must be doing it the wrong way.

    You can do something like:

    select * from table where rownum <= 10

    But if you want the top ten records of an order by you have to do it like this:

    select * from (select * from table order by field) where rownum <= 10

    That's because the "order by" clause is performed after the where clause pares down the result set.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : : I am working with oracle now. And haven't had to use a boolean field.
    :
    : That's another thing, you can't use booleans as table fields, only PL/SQL variables.
    :
    : : But I sort of like Oracle,it has an elegant look to it ,at least for me.
    : : Had worked with SQLServer and is still working with Access .
    :
    : Yeah, it does have some very cool features, but some little things really annoy me.
    :
    : : One other difference I see is that you can't use
    : : "Select top 10 * from table order by order by somefield" in Oracle.But I also read that you can do this,but the order by is after the selection . I must be doing it the wrong way.
    :
    : You can do something like:
    :
    : select * from table where rownum <= 10
    :
    : But if you want the top ten records of an order by you have to do it like this:
    :
    : select * from (select * from table order by field) where rownum <= 10
    :
    : That's because the "order by" clause is performed after the where clause pares down the result set.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :
    Yes , someone told me about rownum.

    MS SQL Server selects the top 10 after the order by.That's a good one.

    Ever used Firebird ? We have plans to use Firebird in place of Oracle.
    MySQL is also an option,but I have heard that it has its limitations.
    Is Firebird better or PostgreSQL ? If any of you have used it,I would like to know how it will behave in an Enterprise Level situation.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories