Date format trouble

I have a data whose date format is like this:
Mon Jun 04 22:17:44 SGT 2007
I need to replicate that same format of data when I do a Select in my table:
select To_Char(sb.directory_listing_expiry_utc,'DY MON DD HH24:MI:SS YYYY') expiry_date from branch
My output is:
Mon Jun 04 22:17:44 2007
I can't seem to replicate that "SGT" in (Mon Jun 04 22:17:44 SGT 2007). How can I produced that SGT in my query?

Is your data stored in a DATE column? Or in a TIMESTAMP WITH TIME ZONE column? Assuming SGT is your time zone, you would need to have the data in a TIMESTAMP WITH TIME ZONE column in order for Oracle to know about, and thus be able to display, time zone information.
If your data is stored in a DATE column, you would have to insert the time zone information into the string that TO_CHAR generates, i.e.
SELECT TO_CHAR( date_field, 'DY MON DD HH24:MI:SS' ) || ' SGT ' || TO_CHAR( date_field, 'YYYY' )
Justin

Similar Messages

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • URGENT: Date format in Reports Giving me trouble...plz help me out

    Hi guru's Can any one help me out
    I
    n the front end apps we are getting the date value as
    BOM_SRS_DATETIME_STANDARD
    Where we are entering the date value as MM/DD/RRRR HH24:MI:SS
    The date format set in the company is like RRRR/MM/DD HH24:MI:SS
    SO I format masked the date parameter in .RDF to RRRR/MM/DD HH24:MI:SS format.
    While the actual date format in the data base is like DD/MM/RRRR HH24:MI:SS.
    I checked all the old reports and the date format is like they masked the date format to company format and used the afterparameter trigger like bellow:
    if :P_SENT_DATE_FROM is not null and :P_SENT_DATE_TO is null then
    :P_SENT_DATE_TO := :P_SENT_DATE_FROM;
    end if;
    if (:P_SENT_DATE_FROM = :P_SENT_DATE_TO) and (:P_SENT_DATE_FROM is not null) then
    :WHERE_SQL := :WHERE_SQL || ' AND CREATION_DATE = '||' to_date('''||:P_SENT_DATE_FROM||''''||','||'''DD-MON-RR'')';
    else
    if :P_SENT_DATE_FROM is not null then
    :WHERE_SQL := :WHERE_SQL || ' AND CREATION_DATE >= '||' to_date('''||:P_SENT_DATE_FROM ||''''||','||'''DD-MON-RR'')';
    end if;
    if :P_SENT_DATE_TO is not null then
    :WHERE_SQL := :WHERE_SQL || ' AND CREATION_DATE <= '||' to_date('''||:P_SENT_DATE_TO ||''''||','||'''DD-MON-RR'')';
    end if;
    end if;
    I tried this but i couldnt get the output either.
    I am pretty much confused.
    Plz help me out...

    If you want to use a dynamic where caluse in your report query you can use a Reference Cursor using REF CUR QUERY tool in your report like this :
    function QR_1RefCurDS return DEF_CURSORS.CHARACT_REFCUR is
    temp_CHARACT DEF_CURSORS.CHARACT_refcur;
    begin
    IF :FROM_NO IS NULL AND :TO_NO IS NULL THEN
    open temp_CHARACT for SELECT ACCT_CODE, ACCT_NAME
    FROM CHARACT
    ORDER BY ACCT_CODE;     
    ELSIF :TO_NO IS NULL AND :FROM_NO IS NOT NULL THEN
    open temp_CHARACT for select ACCT_CODE, ACCT_NAME
    FROM CHARACT
    WHERE ACCT_CODE=:FROM_NO
    ORDER BY ACCT_CODE;     
    ELSIF :TO_NO IS NOT NULL AND :FROM_NO IS NOT NULL THEN
    open temp_CHARACT for select ACCT_CODE, ACCT_NAME
    FROM CHARACT
    WHERE ACCT_CODE BETWEEN :FROM_NO AND :TO_NO
    ORDER BY ACCT_CODE;               
    ELSIF :TO_NO IS NOT NULL AND :FROM_NO IS NULL THEN
    open temp_CHARACT for select ACCT_CODE, ACCT_NAME
    FROM CHARACT
    WHERE ACCT_CODE<=:TO_NO
    ORDER BY ACCT_CODE;     
    END IF;
    return temp_CHARACT;
    end;
    But first you have to declare a cursor type in a package

  • Trouble with date format

    Hello,
    i need some help with date formats. I am using JDeveloper 11g and am trying to write some SQL commands.
    When i enter the following, everything is working correctly.
    ResultSet query = st.executeQuery("select * from DB.TABLE where DATE > '01-01-2000'");
    I need to make it work so that date can be used from a jtextarea.
    String inputData =jTextArea1.getText();
    ResultSet query = st.executeQuery("select * from DB.TABLE where DATE > " +inputData);
    Query does not return anything.
    Do i need to convert the value of inputData? What other problems could there be?
    TY
    Edited by: user10956166 on Apr 1, 2009 4:08 AM

    Correct. Oracle will implicitly convert the date as shown below (see Predicate Information)
    SQL > explain plan for select * from test where modified_date > '01/01/2008 12:00:00';
    Explained.
    SQL > select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3461732445
    | Id  | Operation         | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |       |   677 |   105K|     6   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| TEST  |   677 |   105K|     6   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("MODIFIED_DATE">TO_DATE(' 2008-01-01 12:00:00',
                  'syyyy-mm-dd hh24:mi:ss'))Don't forget to use parameterized queries (a.k.a. bind variables)!
    HTH!

  • Trouble with Import Wizard - Date format

    I am trying to import data from an excel file to a table using the Import Wizard. The verification of the import fails on the verification of the date column only, with the message that "Dater columns HOLIDAY_DATE, have invalid or null date formats"
    There are no null / blanks in my xls file, and the date format in the xls file is dd/mm/yyyy. When this is imported through the import wizard, the date column shows the data, but the format shows the data in mm/dd/yyyy ??
    Is there anything obvious I am doing wrong here?
    Thx

    Well, not really a solution, but a work-around.
    I created an extra field in the table, and loaded the date into that string field.
    Then just updated the table using the follwoing code...simple, but much faster than trying to work out what the roblem was with the upload.
    UPDATE EU_HOLIDAYS
    SET HOLIDAY_DATE = TO_DATE(HOLIDAY,'DD/MM/YYYY');

  • In IOS 6 my date format was YYYY-MM-DD. When I switched to IOS 7, it changed to MM-DD-YYYY. How do you change it?

    In IOS 6 my date format was YYYY-MM-DD, which is ISO 8601 standard used in Canada.  When I switched to IOS 7, it changed to MM-DD-YYYY format which is very confusing as all my cameras etc use YYYY-MM-DD.  How do you change it, like one can in OSX?

    It appears previous versions of IOS would pick up your preferred date format from your OSX Mac. You can modify that to whatever you like.
    Now if you select Canadian or American in IOS 7 you get only MM-DD-YYYY.  This is wrong for Canada as the preferred date format here is YYYY-MM-DD, just check your birth or expiry dates on your Ontario Drivers License or OHIP Health Card.  Or the date field at the bottom left of any Government of Canada website.
    The trouble with using other Country codes is you tend to get their currency codes like € or £ and the terms like yesterday and today in their language.

  • Retrieving acceptable date format

    I'm developing a script using SAP GUI Scripting API,
    There are some fields on user's screen which must be filled with a date.
    For some users, these fields accepts date in MM.DD.YYYY format, while for some others the accepted format is DD.MM.YYYY.
    My question is: How can I know which date format is accepted by a GuiComponent in order to make the correct input?
    Could not find any method or property in any component that could give me a clue.
    (I'm having troubles with decimal values too, once I cannot determine if the separator is a dot or a comma, but I suppose solving the date problem may lead to solving this one too.)
    Thanks in advance.

    Hi Ycarus,
    there are as always several solutions. One of these might look like this:
    For example, is the date entered as follows:: 01.03.2011
    on error resume next
    session.findById("wnd[0]/usr/. . .").text = "31.12.9999"
    if error.number > 0 or error.number < 0 then 
      session.findById("wnd[0]/usr/. . .").text = "03.01.2011"
    else
    session.findById("wnd[0]/usr/. . .").text = "01.03.2011"
    end if
    on error goto 0
    To find out whether a comma or a decimal point to be used as a separator, you could take a similar approach.
    Regards,
    ScriptMan
    Edited by: ScriptMan on Mar 28, 2011 11:10 AM

  • SSRS is weird with date format

    hello everyone,
    I've got the weirdest problem.
    At first it was the calendar in internet exporer showing the dutch format (which i want). After choosing the date i try to view the report. It wil tell me the date isnt in the right format.  So for example. 22-02-2015 is wrong and should be 02-22-2015.
    For the normal user this is annoying enough and i dont understand why the datepicker acts different than the report wants.
    But now even stanger. I wanted to put a default date in my variable so i can test a bit easier. So i fill in 31-12-2015 and its accepted. But when i run the report, it tells me that the format is wrong. Soooooo. I changed the default value to 12-31-2015
    (the english format)..... BUT!!! now the variable default value isnt accepted because its not in the right format.
    Can someone please tell me how i can avoid format changes between browsers/platforms/computers or what so ever.
    there is 1 format i want and nothing else. dd-MM-yyyy thats the way and nothing else.

    Hi Fibre1980,
    As per my understanding, when you preview the report, you hope that the date is displayed in the format dd-MM-yyyy in calendar, right?
    In Reporting Services, the format of date in calendar control depends on your client machines language and regional settings. If you want to display date in the format dd-MM-yyyy, you can get parameter values from a query, so that values get populated in a
    dropdown list and displayed in your required format.
    Here is a relevant thread you can reference:
    https://social.technet.microsoft.com/Forums/en-US/6e719c7b-cfd5-4f0d-a530-f9710704446c/trouble-searching-with-date-format-usuk-formatting?forum=sqlreportingservices
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

  • Long Date Format in Crystal Reports

    Good evening Crystal Reports Experts:
    I have the following trouble, when displaying the long date format ex. 1, March, 1999, my print layout requires that all the format is written in caps, but i have been unable to manipulate the month of the date in order that instead of March the print layout would display MARCH. 
    If anyone could help me to manage that all letters of the month read in CAPS i would appreciate it very much.
    Thank in advance.

    The following formula should work for you...
    UPPERCASE(ToText({TableName.FieldName}, "d, MMMM, yyyy"))
    It's Don's suggestion... Without the searching.
    HTH,
    Jason

  • Date Format Conversion Problem

    Hi I am having trouble converting excel files to PDF.
    I am in Australia and so we use the date format dd/mm/yyyy.
    However when I convert to PDF it changes the date to the American format mm/dd/yyy.
    For example if the date in Excel is 07/08/2013 (7th of August 2013) after conversion to PDF it displays as the 08/07/2013 (8th of July 2013).
    Can someone please tell me how to get Adobe CreatePDF to convert to the correct date format?

    DrClap wrote:
    From the API documentation for SimpleDateFormat:
    "Text can be quoted using single quotes (') to avoid interpretation."
    So your format should be:"yyyy-MM-dd'T'kk:mm:ss.SSz"(Note that I added the "z" at the end to handle the timezone part of your input.)From the description of the OPs problem - that of obtaining the "date" information from an XML file - it seems easier to remove the unwanted characters than to add single quotes where needed.

  • Date Formatting in a Result Field: Crystal Reports 2008

    I'm modifying a report at runtime in c# .Net using Crystal Reports 2008.
    I'm having trouble modifying a date fields format. I have accessed the DateFieldFormat object, and modified the properties, but only the SystemDefaultType property seems to have any affect.
    If the Date format is set in the Visual Report Designer I can see the details of the format in DateFieldObject, but editing these values doesn't have any affect on the report once displayed.
    Here is a sample of the code i'm using:
    public Form1()
         InitializeComponent();
         CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
         ISCDReportClientDocument reportClientDocument;
         // Load Report
         reportDocument.Load(@"C:\myReport.rpt");
         reportClientDocument = reportDocument.ReportClientDocument;
         // Access Field
         FieldObject fieldObject = (FieldObject)reportClientDocument.ReportDefinition.DetailArea.Sections[0].ReportObjects["DateField1"];
         // These work, if I want to use one of the default formats
         // fieldObject.FieldFormat.DateFormat.SystemDefaultType = CrDateSystemDefaultTypeEnum.crDateSystemDefaultTypeUseLongDate;
         // fieldObject.FieldFormat.DateFormat.SystemDefaultType = CrDateSystemDefaultTypeEnum.crDateSystemDefaultTypeUseShortDate;
         // I don't want to use one of the defaults.
         fieldObject.FieldFormat.DateFormat.SystemDefaultType = CrDateSystemDefaultTypeEnum.crDateSystemDefaultTypeNotUsingDefaults;
         // I want to change the order of the values
         fieldObject.FieldFormat.DateFormat.DateOrder = CrDateOrderEnum.crDateOrderDayMonthYear;
         // Display the report in the viewer
         crystalViewer.ReportSource = rpt.rcd.ReportSource;
    I'm assuming I'm missing something about the object model here, but I can't find any good reference to it. Can someone help me out?
    Thanks!

    Hello,
    I find using the Object Browser in .NET IDE is very useful. Or look for the Developers help file
    The API you are using is not the one to use. Try this one:
    public virtual CrystalDecisions.Shared.DayFormat DayFormat { set; get; }
        Member of CrystalDecisions.CrystalReports.Engine.DateFieldFormat
    Thank you
    Don

  • Line Chart - date format

    Hi,
    i have some troubles with a "normal" line-chart. (graphType="LINE_VERT_ABS")
    The data is something like that:
    xvalue           yvalue
    01.01.2006     100
    02.01.2006     101
    03.01.2006     102
    04.01.2006     101
    01.02.2006     102
    02.02.2006     102
    03.02.2006     101
    01.03.2006     100
    02.03.2006     99
    03.03.2006     101
    I define the chart with:
    groups="xvalue" dataValues="yvalue"
    worked fine, BUT:
    I had to change the date-format from dd.mm.yyyy to "only" mm/yy.
    Now just 1 yvalue of every xvalue-group is displayed - the chart has only the following points:
    xvalue          yvalue
    01/06          100
    02/06          102
    03/06          100
    Does anybody know a solution where every point is shown just with the other date-format?

    Change your default system date format.

  • Result of Multiplying a Date formated Cell

    I have recently started using Numbers and having trouble with the date and format options.  I am trying to calculate the number of days between two dates and then multiplying the result by a value. 
    I have been able to format the to and from dates using the date format.  The result is given in days.  When I multiply this day cell by a value the result is given in days and I want it to be the value
    Can anyone help
    Regards
    Arthur

    Arthur,
    I'm sorry about your disappointment. Numbers is a capable spreadsheet program that differs from Excel in some ways and has fewer features, but also has some unique features. Nothing about your problem statement is difficult in Numbers and there is nothing that you will learn in a phone call to Apple that we can't help you with here.
    Anytime you begin using a new piece of software you must expect to invest an hour or two in reading the user guide, at least the first couple of chapters. This is important even if you do eventually go to an Apple tutor. It's important to know the terminology and the basics as they are presented out in the User Guide, available for download from the Help menu.
    Here is an example of your exact problem statement, with as much accuracy as is possible with the amount of detail you provided:
    Date 1 is in Column A, Date 2 is in Column B and the difference is in Column C. This difference in Column C is in the units of Duration, in this case the result "5d" is a duration of 5 days. Column D converts this duration to a pure numeric value. Column E does the multipliation. Of course you could collapse all that calculation business into one cell. The one cell version would be: =DUR2DAYS(B-A)*5.5
    Regards,
    Jerry

  • RS232 data format

    Dear all Dasylab users. I am using Dasylab to connect TSE Syringe pump to PC. I managed to get Dasylab to communicate with my device, but I am having trouble parsing the data effectively. I've been searching the forums and think this has a very simple solution.
    I'm just having trouble finding the correct command to put in the "measurement data format" box for each channel. I get a string: <STX>00P900.5MH<ETX> (in RS232 monitor)
    (It means 00 channel; P status;900.5 value; MH unit) I tested plenty possibilities but nothing works. I need to get all 4 information. Status and unit to the Global string 11 and 12. I thing the correct measurement data format would be:
    Channel 0 - "\x02" 2a
    Channel 1 - $11 1a
    Channel 2 - 5a
    Channel 3 - $12 2a \r\n
    but it doesn’t work (numbers are correct but the strings not). I use (for measurement data request) string “RAT\r\n” at Chanel 0, the other channels are empty.
    The second problem is when I need second information. I use next Channel (Channel 4) with measurement data request RAT\r\n and measurement data format "\x02" x3 5a \r\n. I get in RS232 monitor string <STX>00P42.48<ETX>. If I use only this one channel (as Channel0) so it works correctly but it doesn’t work with the previous four channels.
    Solved!
    Go to Solution.

    Thank a lot for your help.
    Using the "b" instead of "a" helps solve the problem with channel1. But problem with channel3 (UNIT) survive. The string is empty. I can use the same solution as for channel 1(may be, it is even better because I can transfer MH to ml/h) but I would like to know how to send it to the string. (I tested both $12a\r\n and $12a\r strings) It looks, that measuring one time checks the channels 0, 1 and 2 and then waits. (I have action and message box connected to input and if the measuring is correct the messages repeated each 0.5 s (this is a sampling frequency).
    I know that is impossible to use the same search string twice, but I don’t know how send next question/string to the equipment. I tested use new channel and also new slave module, no success.
    Now, when I have the formats:
    Channel
    Format
    request
    answer
    0
    "\x02" 2a
    RAT \r\n
    00
    1
    b
    83
    2
    5a
    900.5
    3
    b
    77
    4
    b
    72
    Everything is correct. When I add one channel, one times the correct values appears at first 5 channels but then all goes wrong and measuring waits:
    Channel
    Format
    request
    answer
    0
    "\x02" 2a
    RAT \r\n
    00
    1
    b
    83
    2
    5a
    42.48
    3
    b
    72
    4
    b
    83
    5
    4x 5a
    DIA \r\n
    When I use monitor and switch repeatedly Chn.0 and Chn.5 I obtain:
    (To CJ Butler: I tried to get data from HyperTerminal, but I am not able to connects the equipment.)

  • Application Date Format 12-¿¿¿-2004

    Why date formats are not interpreted correctly ?
    Apex 3.2 , ORA XE, Win XP 32 SP2,
    When opening particular application:
    Home>Application Builder>Application 31517>Shared Components>Edit Globalization Attributes
    Application Date Format ( List of Values )
    The window appears with:
    12-¿¿¿-04
    12-¿¿¿-2004
    12-¿¿¿
    04-¿¿¿-12
    2004-01-12
    ¿¿¿¿¿¿¿¿¿¿, 12 ¿¿¿¿¿¿¿, 2004
    12-¿¿¿-2004 14:30
    12-¿¿¿-2004 14:30:00
    12-¿¿¿-2004 02:30PM
    16 hours ago
    Row(s) 1 - 11
    I have tried with changeing some parameters, reinstall XE DB and APEX,
    but without success on date format.
    Any help to fix date format ?

    Client configuration is the main factor for date formats, settings can be made in the database server for defaults but can be overridden according to the client. And check the browser language (and font) settings they can also be a factor.
    Start with checking the national language settings ( sqlplus > show parameter nls;) and did you install the Western European, or Universal version? (Windows? Linux?)
    Client settings are picked up from environment variables, the most important is NLS_LANG specifying client country, region, and character set so that the right characters are shown to the client (i.e. which currency symbol, number formats: 9,999.00 or 9.999,00) and in the U.S, we write dates as mm/dd/yy, while in the UK and most of Europe its dd/mm/yy. And the environment settings can be overridden within a session too, i.e. in sqlplus:
    select sysdate from dual;
    alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
    select sysdate from dual;
    And check the NLS_LANG setting ...
    \[linux\]$ echo $NLS_LANG
    \[win\]$ echo %NLS_LANG%
    The character set for the database can cause trouble especially when the client settings are incorrect or invalid. Easiest way to find the db setting is SQL> alter database backup controlfile to trace; and check the trace file created in the user_dump_dest folder ...

Maybe you are looking for

  • P35 Neo - XP Pro install fatal error

    Hello I have partially duplicated my post since the problem is different from the original thread. But first.... MOBO - P35 Neo - MS-7360 CPU - Intel Core 2 Duo E6750 BIOS - V1.5 MEM - 4 x 1Gb 800Mhz DDR2 HDD - 1 x 250 Gb Maxtor SATA II (I have 2 but

  • Is Quality management module required to be used for vendor evaluation?

    Hi, There is vendor evaluation functionality in MM. Is use of quality management module is mandatory for this? I wish to track the performance of vendor regarding quality (How much he has supplied, out of which how many are accepted and how many are

  • How to open multiple tabs in FF???

    Hi all just wondering if it possible to highlight multiple links and then open them all in new tabs at the same time? For example if i have a page full of thumbnails which link to big pictures, can i highlight a bunch of the pictures then open them a

  • HT201263 ipad 2 wont start

    my ipad 2 stoped working a few hrs ago i was just simply watching a video and it froze and i let it sit to un freeze and it completyly turned off and yes it did have full charge and after that it wont turn back on if i press the sleep and home botton

  • Re install previous version

    I experienced headache problem after updating to 10.2 version,when i follow this forum,seems so many different problems with this update issue,just want to share,may be it will be helpfull for the flash player user,why don't just uninstall 10.2 versi