Date formatting according to UTC timezones

Using MySQL, php
www.freecrm.x10hosting.com
Before setting up my tables, I need to better understand the
relevance of the datetime and conversion of this field.
I am based in th UK (UTC, Greenwich mean time), but my host
is in the states, which means that the "now" date and time is based
on US time (UTC - ?)
I have done formatting of the date i.e. <?php echo
date('D, d/m/Y',strtotime($datetime['DATETIME'])); ?> but am not
sure how to approach the problem relative to the timezone of any
visitor in the world.
I have a sniffer script which detects the browsers language
but I can't see that being of much use.
The site does require a register/login so I suppose I could
have a UTC preference (i.e. UTC + 3 or whatever) set into their
record. This could then be used something like this.
<?php echo date('D,
d/m/Y',strtotime($datetime['DATETIME']+$row_recordsetuser['UTCTIMEZONEPREFERENCE']));?>
Does this make sense?
I know the formatting is going to be a challenge as well
because the US uses m/d/Y,
Or is there a way of formatting the MySQL data before its
even called?

.oO(RichardODreamweaver)
>Using MySQL, php
>
>
http://www.freecrm.x10hosting.com
>
> Before setting up my tables, I need to better understand
the relevance of the
>datetime and conversion of this field.
>
> I am based in th UK (UTC, Greenwich mean time), but my
host is in the states,
>which means that the "now" date and time is based on US
time (UTC - ?)
Check date_default_timezone_set().
> I have done formatting of the date i.e. <?php echo
date('D,
>d/m/Y',strtotime($datetime['DATETIME'])); ?> but am
not sure how to approach
>the problem relative to the timezone of any visitor in
the world.
You can only deal with your server's timezone setting.
> I have a sniffer script which detects the browsers
language but I can't see
>that being of much use.
It's of absolutely no use. English and Spanish for example
are spoken
all around the world, probably somewhere in almost every
timezone.
> The site does require a register/login so I suppose I
could have a UTC
>preference (i.e. UTC + 3 or whatever) set into their
record.
Possible. If UTC/GMT is not enough, you could let the users
choose the
offset themselves. This is how it's done in many popular
forum scripts.
>This could then
>be used something like this.
>
> <?php echo date('D,
>d/m/Y',strtotime($datetime['DATETIME']+$row_recordsetuser['UTCTIMEZONEPREFERENCE
>']));?>
>
> Does this make sense?
>
> I know the formatting is going to be a challenge as well
because the US uses
>m/d/Y,
YYYY-MM-DD
Works always. ;-)
> Or is there a way of formatting the MySQL data before
its even called?
Of course you can also let MySQL return an already formatted
date, which
is usually the preferred and most efficient way. Have a look
at MySQL's
date and time functions, especially DATE_FORMAT().
Micha

Similar Messages

  • How to Change Date Format according to the Locale/Country of Portal User

    Hi,
    In a webdynpro applicaiton, how to chage the  Date Format according to the Locale/Country of Portal User.
    Consider for INDIA: mm/dd/yyyy
    Consider for UK: yyyy/mm/dd
    So when i select the date from the Date Picker[input ui element bound to date context variable], the date format should be displayed accroding the portal users country/locale.
    Creating a simple type for every date format in the dictionary would not be the right solution.
    Please help.
    Thanks,
    Regards,
    Aditya Metukul

    Hi Aditya,
    Check out the following post in SDN and refer the
    Bertram's reply on the same topic.
    date format
    Regards,
    Shubham

  • List of Number format and Date format according to the Locales

    Hallo everyone.
    I am searching for a list or document which includes the number and date formats according to the country locales. Where can I find sort of document?
    Another question: Where can I find the all parameters of swing.properties file?

    "Date - allows the user to enter a date as a parameter. Note that the data type must also be "Date" and the format must be Java date format."
    Page 4-9, Adding Parameters and Lists of Values
    Oracle® Business Intelligence Publisher
    Report Designer's Guide
    Release 10.1.3.4
    Part No. E12187-01

  • Date format according to user region

    Hi All,
    I have an explorer where data is coming from hana cubes, what i want is :- if a user in usa opens the information space than date should be displayed as mm-dd-yy and for an Indian user it should be dd-mm-yy
    I am using bo 4.1 sp3.
    thanks in advance,
    Yash

    Hi Yash,
    On the SAP HANA side you must have enabled translations into the different languages for the text. At the same time the date format should also change.
    As a test change the locale of the HANA client and retrieve date results:
    http://scn.sap.com/thread/3301295
    Then according to the Users BI launchpad locale settings, it should format in Indian locale.
    Here a link which states that at least the numeric format can also be changed directly in Explorer (I haven't checked the date).
    https://ideas.sap.com/ct/ct_a_view_idea.bix?idea_id=81DAB90F-6096-4F78-BB3B-384D1826F337
    Denis

  • Converting time stamp in SECONDS to a calendar date format.. problems

    Hello. I'm trying to convert a long interger that represents the number of SECONDS passed since the 1970 date
    the number was originally generated by php's mktime() function
    one of the numbers I have for example is this : 1126933200
    I haven't done the math but this is a date probably around september of 2005.. it's irrelevant anyhow.
    I want to convert this to a date format I can use in java. I've tried to create a new date like so :
    Date date = new Date(1126933200);
    I've also tried it with the calendar method like so :
    Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(1126933200);
    it was only then that I realized that both these methods require the number of MILLI seconds. So I tried doing a simple multiplication by 1000 on my original number and then I started getting a "integer number too large" error when trying to compile.
    so i'm kind of at a loss here.. i figure I could make a function myself that would divide my number in days of 86400 seconds.. and then i'd have to keep in mind the bisectal (sp) and the months with more and less days etc.. but i'm sure there must be an easier way.
    and i don't get why a method who's meant to receive a very long number is giving me an error when i try to give one to it.
    your help is appreciated as always. thanks

    Hello. I'm trying to convert a long interger that
    represents the number of SECONDS passed since the
    1970 date
    the number was originally generated by php's mktime()
    function
    one of the numbers I have for example is this :
    1126933200
    I haven't done the math but this is a date probably
    around september of 2005.. it's irrelevant anyhow.
    I want to convert this to a date format I can use in
    java. I've tried to create a new date like so :
    Date date = new Date(1126933200);
    I've also tried it with the calendar method like so
    Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(1126933200);
    it was only then that I realized that both these
    methods require the number of MILLI seconds. So I
    tried doing a simple multiplication by 1000 on my
    original number and then I started getting a "integer
    number too large" error when trying to compile.So you needed to add L to one of the numbers.
    Note you also need to define what timezone that seconds number represents.
    With Gregorian it is going to use the local timezone (the code here will anyways). The code using Date is using the UTC timezone.

  • Date format in Tablecontrol....

    Dear Experts,
    I have a type '1' program in which a screen is being called. The program displays and updates some personal information (employee info )in a Z table. The screen conatain a table control. And one of the column in the table control is of type DATE (DATUM/DATS/8), which displays the joining date of employee from the Z table.
    This program works fine when the user's date format is system default ie YYYMMDD(internal date format). But if a user with a different date format runs the program (say DDMMYYYY) the date field in the table control will be displayed incorrectly ( like YY.YY.DDMM) and then the user cant trigger a PAI. System will give error message "Invalid date format".
    When i debug the report, i can find that the corresponding date fields in ABAP are in internal format (YYYYMMDD). What can be the solution?
    Do i need to change all the date values according to user parameter in the program, before display? Or is there any option in screen painter, which will automatically convert the date format according to user defaults?
    this is an urgent issue here...
    Thanking you in Anticipation
    Deepak

    Hello Friend,
    Normally incase of dates, different users may have different date settings..So the standard procedure is..
    1. take the date into a CHAR field
    2. declare a variable with type DATE (LIKE required table
       field ).
    3. assign the CHAR field to DATE field
    4. Again assign the DATE field to CHAR field using
       WRITE...TO.
    For eg.
    Please have a look at the below code.. It may help you.
        perform format_date  changing   lwa_output-DATAB_new.
    (* here 'lwa_output-DATAB_new' is an internal table field)
    FORM FORMAT_DATE CHANGING P_DAT_NEW.
      data: l_f_datum    like rv13a-datab.
      data: l_f_date(2)  type c,
            l_f_mont(2)  type c,
            l_f_year(4)  type c.
      data:  SEPER TYPE C,
             BUF(256).
    get the date fields seperator
      BUF = P_DAT_NEW.
      TRANSLATE BUF USING '0 1 2 3 4 5 6 7 8 9 '.
      CONDENSE BUF NO-GAPS.
      SEPER = BUF(1).
      clear: l_f_date, l_f_mont, l_f_year.
      SPLIT P_DAT_NEW AT SEPER INTO l_f_date
                                    l_f_mont
                                    l_f_year.
      clear p_dat_new.
    concatenate l_f_date l_f_mont l_f_year into p_dat_new.
      concatenate  l_f_year l_f_mont l_f_date into p_dat_new.
      clear l_f_datum.
      l_f_datum  =  p_dat_new.
      clear p_dat_new.
      write l_f_datum to p_dat_new.
    ENDFORM.                    " FORMAT_DATE
    Plz..Reward me if it works..

  • Smartform and date format

    if i need the change the date format according to country how can i do it
    ( i.e ) I am creating a smartform, the date format i use is normally dd/mm/yyyy
    if the same smartform is printed in some other country( using format yyyy/mm/dd or any format)
    i want my date format to change based on where it is printed.
    In SAPScripts there is a command SET COUNTRY.
    Can I use this command for my requirement. If so How?

    hi check this referred link and do the coding accordinly...please search before you post ..
    Country specific date format
    and try this C14N_COUNTRY_DATE_DECF_GET too
    Edited by: Venkat Appikonda on Jan 28, 2009 12:37 PM

  • Date Format issue while creating date parameter

    While creating date parameter in the crystal reports 2008 with SQL Server 2008 database connection, I want to change the date format according to the specified format in the database.
    For ex: YYYY/MM/DD and MM/DD/YYYY
    This paramter will be editable in the viewer i.e. I'm going to provide option to the user to change start date and end date for data selection.
    Please help!
    Thanks in Advance!

    i found this
    i am trying to get the Enter Values screen for parameters to allow entry in a specific format 'DD-MON-RRRR' connecting to an Oracle database. I found that a hack is possible yet I would prefer a clean solution that wont need files changing on client machines. The hack involved changing some javascript files within the Crystal Reports directory. The problem is I now have the date from the calendar in the correct format but it displays the following prompt: Please enter DateTime in format "dd/mm/yyyy hh:mm:ss".
    Is there a way to supress this or better yet a way to specify date format without changing the javascript files of Crystal Reports.
    I am using Crystal Reports 2008 SP1.
    answer---
    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:

  • Controlling the Date Format

    Hi
    A sample web dynpro application displays information regardding Flight information with the flight date.
    This application is integrated in portal too.
    However, there is a requirement that end user can adjust the date format as yyyy-mm-dd or dd-mm-yyyy or mm-dd-yyyy format.
    I changed these options in Windows Regional settings to different values for the short date and long date formats. Unfortunately these changes do not reflect in the iView.
    Is ther any setting at the iView when developing the portal content or any other way to allow the user to see the date in the format he likes ? if yes, what needs to be done ?
    Thanks
    Prasad

    Hi Prasad,
    Try to use the browser locale setting instead of Windows regional setting.  You can get the browser locale
    setting from the below code
    Locale locale = request.getServletRequest().getLocale();
    Then use this locale data pattern and display date formats according to user browser locale settings.
    Hope this helps.
    Siva

  • Date format(UTC Time Stamp in Short Form (YYYYMMDDhhmmss)

    Hello Everybody,
                            I am facing a problem regarding creating an update program. The program will pick up data from a DB table through the RFC: RFC_READ_TABLE and then it will modify the custom DB table present in the system from where the program will be executed. Among the data of the fields to be transfered date field will be present but the format is of UTC Time Stamp in Short Form (YYYYMMDDhhmmss). Data is coming properly inside the internal table of the program, but on encountering a MODIFY or an INSERT statement its giving a short dump with a message: In a statement an invalid request was made to the database interface when accessing table "ZZTTT". What to do to transfer the data for the date field for the above said format. Eagerly waiting for your reply. Enclosed below the domain of the data element used in the table:
    Domain name: TZNTSTMPS(Data Type:DEC, No of Char: 15, Output Length: 19)
    Regards,
    Pulokesh

    data : d like sy-datum.
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC' INTO
            DATE d TIME t.
    Check also fm : 'CIF_GEN3_CONVERT_TIMESTAMP'
    Hope this helps,
    Erwan

  • Date Format of Date Picker in Webdynpro to be Changed according to Country

    Hi,
    I want to change the Date Format of Date Picker in Webydnpro accoding  to the portal users country.
    As each and every country has its own date format, i can't create simple types of date formats in Data Dictionary and bind them dynamically.
    Even the webdynpro date picker doesn't change according to the portal users country/locale, I tested with different countries for a portal user by changing in portal user profile.
    Please help .
    Regards,
    Aditya Metukul

    JUST WE HAVE TO CHANGE THE LANGUAGE OF THE USER

  • Php input date/time as timestamp with timezone

    This is a nightmare!!!!
    I have numerous databases, all of which use timestamp format
    date/times, which are easy to echo according to user timezone
    preferences using putenv ("TZ=".$_SESSION['MM_UTZ']); and echo
    date($_SESSION['MM_UTF'], ($whatever));
    The only problem is, I have only used these for stamping
    "date created" or "date edited" values using Time()
    What I am trying to achieve is:
    User 1 in UK enters date and time, using a javascript
    datetime picker (which normally enters data into field in Y-m-d
    H:i:s) and the php inserts this in timestamp format according to
    timezone.
    User 2 in US looks at date and time and this is echo'd
    according to his timezone.
    Sounds simple...
    I have managed to get so far with the new DateTime object
    which incorporates the user timezone preference ($utz)
    $ndttime= new DateTime($timefield, new DateTimeZone($utz));
    I can then echo this effectively using
    echo $ndttime->format('$utf'); ($utf being user timeformat
    preference)
    My stupid problem is trying to get the $ndtime into the
    database!!!!
    I know this sounds ridiculous but I use the DW insert wizard
    which only uses values from a form and if I echo $ndtime into a
    hidden field, it doesn't process this value in time.
    I attach the current insert script.
    Is this simple?
    Heeeeelp.

    quote:
    Originally posted by:
    AXEmonster
    how does this format when you echo to the page
    echo $ndttime->format('$utf');
    This will echo as a date/time object - i.e. Y-m-d H:i:s, but
    the $utf variable is a session variable with user time format
    preferences, so it could be D, d/m/Y H:i:s or m-d-Y H:i:s
    etc.

  • Need to convert into date format

    Hi all,
    I need to convert '2008-11-26T11:07:38-06:00' [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS][TIMEZONE]
    in format 'YYYY-MM-DD HH:MM:SS'.
    Thanks in advance.

    >
    Thank you for your reply
    But it is giving me output as '26-NOV-08'
    And I want in format '2008-11-26 07:38' i.e 'YYYY-MM-DD HH:MM'.
    >
    Then you are not looking for a date, You are looking for a string.
    The date format that gets displayed is dependent on nls_date_format parameter.
    If you want a string in the format you asked, then,
    SELECT TO_CHAR ( TO_DATE ( '2008-11-26T11:07:38-06:00', 'YYYY-MM-DD"T"HH24:MI:SS"-06:00"'), 'YYYY-MM-DD HH24:MM:SS')
      FROM DUAL;Or if you just want the date to be displayed like that then
    Do,
    SQL> alter session set nls_date_Format="YYYY-MM-DD HH24:MI:SS";
    Session altered.
    SQL> SELECT TO_DATE ( '2008-11-26T11:07:38-06:00', 'YYYY-MM-DD"T"HH24:MI:SS"-06:00"') dt
      2    FROM DUAL;
    DT
    2008-11-26 11:07:38
    SQL> G.

  • Date format of footer in pdf

    How to change the date format of footer from dd/mm/yyyy to Monday 09 August 2010 when we down load the report in pdf file

    Hi,
    Revenue is a sample column. You can pull any measure column used in the report.
    And put this formula in a separate new column. And in the narrative view use this column number.For Ex- if the number of the column in the criteria is 15, then mention @15 in the narrative view.
    NOTE-Rows to display in narrative view should be set to 1.
    And in the formula-CEILING(CAST(COUNT("F1 Revenue"."1-01 Revenue (Sum All)") as DOUBLE)/ 25)
    25 refers to the number of row count to display. You can define the number according to your requirement.
    Regards,
    MuRam

  • SSAS Cube parameter date format change

    Hi Experts,
    I am new to SSRS report creation. I have a parameter which is fetching date from cube. The date format from cube is YYYY-MM-DD.
    I want expression to change the date format to DD/MM/YYYY.
    I have used this expression - =Format(CDATE(Parameters!DimPromoUBUBStartDate.Value),"dd/MM/yyyy")
    but it is not working and getting the following error,
    "unable to cast object of type 'System.object[]' to type 'system Iconvertible'
    Please give your suggestions
    Thanks in Advance,
    Rajan

    Hi Rajan,
    According to your description, when you convert the "YYYY-MM-DD" formatted data from the parameter and change the format, it throw the error above. Right?
    In this scenario, the reason why you get this error because you set allow multiple values in that parameter. When we allow multiple values in a parameter, all select values will be put into a array when processing even you only select one value. And
    the CDate() function can't convert the object[]. So please unselect the allow multiple values in parameter. If you want to keep multiple values selection, you can only convert one element from the array. For example: CDate(Parameter!XXXX.Value(0))
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

Maybe you are looking for

  • Formula variable using Replacement path not working

    Dear All, I am using a query to calculate YTD values in the report. I am using a formula variable to calculate the number of months. Formula is Month To - Month From+1 When I am giving the range from 001 to 006 for period in th evariable screen, I am

  • Windows 7 x64 - iPhone and iTouch - iTunes Sync errors on new HP Dv8

    PROBLEM DESCRIPTION: I just purchased a brand new HP dv8 laptop and cannot get my iphone or itouch synch. I get errors for both the iphone and itouch, but my Nano and shuffle are fine. HP support said that this is a known issue and that the software

  • Can I install a SATA drive in Mirror Drive Door G4?

    I am looking at a Seagate 500 GB SATA drive at a great price at MWave ($109.) but see that SATA may require a different cable connector from the IDEs that I normally use in my box. Can I buy some kind of adaptor cable, or do I have to get a card of s

  • Pl/sql function body returning SQL query - Print function

    Hello all, I have pl/sql function body returning SQL query for my reports for my new project that I am developing. We dont have any BI tool or anything for APEX so we use Oracle reports to get the same reports to be printed in PDF format. I had been

  • Probs with NFS dates in Lion?

    Using Lion as the NFS server to OpenVMS, I get some odd results. From the OpenVMS side, the file dates/times are correct, and display the "true" vallues when looking at the mounted drive. From the Lion side, everything has the same date/timestamp...a