Format of the DateTime field American / English

LAMP system

I have a table with a datetime column that is in the format YYYY-MM-DD hh: mm:.

As we are in the sunny United Kingdom, I would like the fields be formatted in DD-MM-YYYY hh: mm:.

I tried the extension of the application, but the results of all pass them as 01/01/1970 instead of display the correct data.

Is this a problem of ranking (currently in utf8_general_ci) or is there a simple way to put in shape view fields and the form input fields?

RichardODreamweaver wrote:
> I finally managed to find an answer...
>
> See the code.
>
> I needed to express the chain of the recordset as a timestamp value which could then be output using the usual formatting.

Two things, Richard. First of all, do NOT use the code attach feature
the web interface of the forum. Your code is removed when displayed in one
News Reader. I took the trouble to look at the web interface to see your
original message. Not only the code was stripped, but if has
the last paragraph of your message. The problems with the News/web player
the interface are not your fault, but the web interface is so slow, more
long term posters here refuse to use it. As a result, many of your
questions will be ignored.

Secondly, your "solution" is ineffective because we enter the
result from the database, converting into a Unix timestamp, then
using the date() function PHP again convert. If you read the
earlier messages from Makowiec Joe and me, you could accomplish all
thing in a single operation with the DATE_FORMAT()) MySQL function.
You are doing extra work for yourself and for the web server.

Now, this issue that has been deleted. There are two reasons you
can get 01/01/1970: either the field is empty, or more probably than he
contains an invalid date. To check, you must wrap your code
in a conditional statement like this:

<>
If (! empty ($row_tasklistquery ['ACTDATE']) |)
substr ($row_tasklistquery ['ACTDATE'], 0, 4)! = '0000') {}
code to display the date
}
else {}
code to deal with empty date
}

--
Adobe Community Expert David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Tags: Dreamweaver

Similar Questions

  • property of format to the digital field mask

    Hi all. I'm on devsuite 10g.
    I have a little problem with the format of a numeric field mask property.

    I want to display like this:

    3,000,000,000

    But in the format mask property if I put the 9G999G999G990 I got this result:
    3 000 000 000

    I read that I should change the parameter NLS_LANGUAGE but surely, there would be problems with the other columns in the database, such as the columns date, ecc.

    How can apply a mask to format my field to see 3,000,000,000?

    Thank you all for collaboration,
    Fabrizio

    Oh, sorry; You must add it without the quotes:

    NLS_NUMERIC_CHARACTERS=,.
    

    see you soon

  • Query of a query term taken from the DateTime field

    Thank you in advance for your help!

    How to retrieve time to a datetime field in a query of a query and sort results by time?  "aDateTime" is a datetime field in a MS - SQL database.  We use ColdFuson 5.

    < name cfquery = "anSQLquery" datasource = "" #aDataSource # "dbtype ="odbc">"

    Select *.

    of Àtable

    < / cfquery >

    ATTEMPT 1:

    < cfquery dbtype = "query" name = "aQueryOfQuery" >

    Select *,.

    Cast (aDateTime as time) as aTime

    of anSQLquery

    order by

    aTime

    < / cfquery >

    < cfdump var = "#aQueryOfQuery #" >

    RESULT:

    aTime

    {ts ' 2012-02-27 08:00 '}

    That is not what is sought, which is something like:

    {ts ' 1900-01-01 08:00 '} or

    {ts ' 08:00:00 '} or

    ' 08:00:00 ' or

    ' 08:00 '.

    Other attempts:

    DatePart (BEGIN_DATE_TIME, "HH: mm") as MeetTime

    right (cast (BEGIN_DATE_TIME as varchar), 8) as MeetTime

    Lead to errors.

    Thank you

    Jeff

    One Solution:

    Select *,.

    Cast (cast (aDateTime as double) - cast (aDateTime as integer) as date) as aTime

    of anSQLquery

    order by

    aTime

  • Null value in the Datetime field

    I have a form that inserts data, but the date fields have a value default (01/01/1900 12:00:00 AM) even if I do not insert a value for this field. How to enter a NULL value in the fields of datatime value MSSQL.instead default (01/01/1900 12:00:00 AM) that gets inserted?

    Here's my insert statement.

    < type CFLOCK = "exclusive" timeout = "10" >
    < name CFQUERY = "InsertWorkflow."
    DataSource = "" #request.app.DSN # ""
    username = "" #request.app.bsruser # ""
    Password = "#request.app.bsrPassword #" >
    INSERT INTO #request.app.DB # .v_NAR_WorkFlowLog
    ([SatApp_ID]
    [User_ReqApproval_Logon]
    [User_ReqApproval_Date]
    [Admin_ReqProcessed_Logon]
    [Admin_ReqProcessed]
    [Prelim_Approval_Level]
    [Prelim_Approval_Date]
    [Prelim_Approval_Explain]
    [Req_Withdrawn_Date]
    [Req_Withdrawn_Explain]
    [Req_Denied_Date]
    [Req_Denied_Explain]
    [User_Req_FinalAppl_Date]
    [Admin_FinalAppl_Date]
    [DateLastUpdated]
    [UpdatedBy])
    VALUES
    (#SatApp_ID #)
    , "#User_ReqApproval_Logon #
    , "#User_ReqApproval_Date #
    , "#Admin_ReqProcessed_Logon #
    , "#Admin_ReqProcessed #
    , "#Prelim_Approval_Level #
    , "#Prelim_Approval_Date #
    , "#Prelim_Approval_Explain #
    , "#Req_Withdrawn_Date #
    , "#Req_Withdrawn_Explain #
    , "#Req_Denied_Date #
    , "#Req_Denied_Explain #
    , "#User_Req_FinalAppl_Date #
    , "#Admin_FinalAppl_Date #
    , "#DateLastUpdated #
    ("#UpdatedBy #")
    < / CFQUERY >
    < / CFLOCK >

    Thank you

    Shearak

    CFQueryParam would work? For example:

    So, using your example, this would be your insert:


       
    DataSource = "" #request.app.DSN # ""
    username = "" #request.app.bsruser # ""
    Password = "" #request.app.bsrPassword # ">"
    INSERT INTO #request.app.DB # .v_NAR_WorkFlowLog
    ([SatApp_ID]
    [User_ReqApproval_Logon]
    [User_ReqApproval_Date]

    [Admin_ReqProcessed_Logon]
    [Admin_ReqProcessed]
    [Prelim_Approval_Level]
    [Prelim_Approval_Date]
    [Prelim_Approval_Explain]
    [Req_Withdrawn_Date]
    [Req_Withdrawn_Explain]
    [Req_Denied_Date]
    [Req_Denied_Explain]
    [User_Req_FinalAppl_Date]
    [Admin_FinalAppl_Date]
    [DateLastUpdated]
    [UpdatedBy])
    VALUES
    (#SatApp_ID #)
    , "#User_ReqApproval_Logon #
    , "#User_ReqApproval_Date #
    , "#Admin_ReqProcessed_Logon #
    , "#Admin_ReqProcessed #
    , "#Prelim_Approval_Level #
    , "#Prelim_Approval_Date #
    , "#Prelim_Approval_Explain #
    , "#Req_Withdrawn_Date #
    , "#Req_Withdrawn_Explain #
    , "#Req_Denied_Date #
    , "#Req_Denied_Explain #
    , "#User_Req_FinalAppl_Date #
    , "#Admin_FinalAppl_Date #
    (, ' #UpdatedBy # ')
       

  • What is the syntex to interrogate the datetime field?

    Hello

    I am trying to retrieve all contacts modified folder > some time using the Eloqua API.  I tried different formats, but none seem to work.

    I tried < ns:searchQuery > C_DateModified > 2014 - 07 - 21 12:00:00.000 < / ns:searchQuery > and received the error "the SearchQuery parameter is not in the correct format.".

    I tried < ns:searchQuery > C_DateModified > 2014-07-21 T 12: 00:00.000Z < / ns:searchQuery > and received the error "failed to Contact request.

    Thanks in advance for any suggestions.

    Khu

    When you query by date you don't need a single quotation mark.  But when you query by datetime, you need single quote around the input value.  So the following works.

    C_DateModified > ' 2014-07-21 12:00:00.000'

  • Work of doesn´t HTML format after update to vCO 4.2.1 in the description field

    Hello

    I installed a new server of vCO with the 4.2.1 version and import an existing workflow. My problem now, I used the html format for the description field to the title of the presentation of a table or test in bold, italic, etc.

    It works perfectly und 4.2.0, but now I have the screen on my page:

    Here is the screenshot of 4.2.0

    Someone has an idea what changes between versions?

    Hello

    You can check here http://communities.vmware.com/message/1888609

  • Formatting of the address in a single fields

    With the help of Acrobat X PRO:

    I have a document of several page, where a user is invited to address in two different formats:

    (1) with the address divided into 4 different values/fields:

    Street field, City field, field, the State Zip field

    Example: "1234 County Rd" (Next Line) "St Louis", "MO" "55555".

    2) with all together address:

    Full address on a single line to a maximum of 40 characters.

    Example: 1234 County Rd., St. Louis, MO 55555

    ---

    I would like users to be able to fill the Street, City, State and Zip, and no matter what the format of the following fields are autopopulated of data.

    This isn't a problem for example #1.  However, with #2 if I place all the fields close together, I have to guess on how remote for each field of space and have always adapt and be correctly formatted.

    Is it possible to combine the values in the 4 fields into a single value (separated by commas)?

    Make the 'auto adjustment' address field may be necessary, but it is ugly, if there is more space in the remaining fields.

    PLEASE SEE THIS document of the EXAMPLE I created for the purpose of this post

    Yes, it is all set up for it. You can add the following function to a JavaScript script at the level of the document:

    Include in a JavaScript script at the level of the document

    function concatAddress() {}

    Get field values and place it in the table

    var aa = [];

    Street of var = getField("Street").valueAsString;

    If aa.push (street) (Street);

    var city = getField("City").valueAsString;

    If aa.push (City) (City);

    var State = getField("State").valueAsString;

    If aa.push (State) (State);

    Code postal var = getField("Zip_Code").valueAsString;

    If aa.push (postal code) (postal code);

    Concatenate and set the value of this field

    Event.Value = aa.join (",");

    }

    And call it from the event calculate any field you want to fill with full address:

    Custom calculate script

    concatAddress();

    The full address fields do not need to be named the same, but they will have to call the same function in their calculation of the events. You can change the name of the function if you wish.

  • Display data DateTime Fields in the local time zone

    I have a table defined as follows:

    create table TimeTest
    (
    DATETIME TIMESTAMP (0) WITH TIME ZONE
    )

    I insert two lines where the time zone changes to a date given in the spring:
    insert into timetest values (datetime) (to_timestamp_tz (' 08/Mar/2009:01:59:55-0500 ',' DD/my/YYYY:HH24:MI:SS TZHTZM ""));
    insert into timetest values (datetime) (to_timestamp_tz (' 08/Mar/2009:03:00:00-0400 ',' DD/my/YYYY:HH24:MI:SS TZHTZM ""));

    How can I select the datetime field in the time zone of my choice? If my session time zone is - 0400, should not 01:59:55-0500 displayed as time 02:59:55?

    The session time zone is:
    Select double sessiontimezone;
    -04:00

    So why do I get this:
    Select to_char (datetime, ' DD/my/YYYY:HH24:MI:SS TZHTZM "") of timetest;
    08/Mar / 2009:01:59:55-0500
    08/Mar / 2009:03:00:00-0400

    I thought I would get this result instead:
    08/Mar / 2009:02:59:55-0400
    08/Mar / 2009:03:00:00-0400

    Thank you
    Troy

    Published by: cforasun on April 8, 2010 17:36

    It is stored as a timestamp with time zone, so you must cast in the local time zone for your database:

    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as fsitja
    
    SQL>
    SQL> create table TimeTest (DATETIME TIMESTAMP(0) WITH TIME ZONE);
    
    Table created
    SQL> insert into timetest(datetime) values (to_timestamp_tz('08/Mar/2009:01:59:55 -0500', 'DD/Mon/YYYY:HH24:MI:SS TZHTZM'));
    
    1 row inserted
    SQL> insert into timetest(datetime) values (to_timestamp_tz('08/Mar/2009:03:00:00 -0400', 'DD/Mon/YYYY:HH24:MI:SS TZHTZM'));
    
    1 row inserted
    SQL> commit;
    
    Commit complete
    SQL> select datetime, cast(datetime as timestamp(0) with local time zone) from timetest;
    
    DATETIME                                          CAST(DATETIMEASTIMESTAMP(0)WIT
    ------------------------------------------------- --------------------------------
    08/03/09 01:59:55 -05:00                          08/03/09 03:59:55
    08/03/09 03:00:00 -04:00                          08/03/09 04:00:00
    
    SQL> 
    
  • Validation of DateTime field (without custom management functions)

    Hello

    I need to know how I can validate if a date is correct or not and fail to do something.

    I have a DateTime Field field, with a pattern ' DD / MM / YYYY ', the value appears correctly using the selected template, the problem is validation.


    Now I just that if the date is wrong, teaches an alert to the user, and the focus returns to the DateTime control until you enter a valid value.

    I need something like:

    -Form1.SUBVENCION_O_AYUDA.dateTimeField1: Validate - (JavaScript, client).

    If (this.rawValue! = null & &! test (this.rawValue, ' DD/MM/YYYY')) {}

    xfa.host.setFocus ("this");
    }

    How will I know if the validation is successful or not (without having to implement long-standing management functions)?

    By default, if I put 'validation model messaga' field, a warning message is displayed, but here the emphasis is more and the user can continue to fill the rest of the form, whereas the datetime field is filled with an incorrect value.

    I want to warn the user to continue to fill out the form, if the value in the dateTime field is not valid.

    Any idea?

    Thank you!

    Hello

    If your date may not be formatted correctly against your view model then the formattedValue is equal to the rawValue.

    Thus, in the event output put;

    If (this.rawValue is this.formattedValue)

    {

    App.Alert ("enter a date in the dd/mm/yyyy" format "");

    xfa.host.setFocus (this.somExpression);

    }

    Bruce
  • What is the difference between the Chinese version and English for Windows 8?

    I would like to know the differences between the version in American English and Chinese Simplifued (RPC) of MS Windows 8 and the Suite MS Office 2013. I'm a native English speaker, but I currently live in China and sometimes need to write Chinese or use Chinese applications. Are there benefits or disadvantages between the two versions?

    Thank you, in other words, if the label of the packaging of Win8 displays 'Simplified Chinese Version' or 'English Version' they are the same, except for the main language setting?

    I am in China and it is easier for me to buy the Version of Win8-simplified Chinese. If I set the main language in English, then it becomes 'English Version'?

  • Calculation of the date fields

    Hello

    I have three fields. 2 are formatted with the date field, and the third for the calculation of the difference between 2 date fields.

    For example, Field1 said August 2012, and field 2 said Sep 2012. Is it possible that I can do field 3 dipslay the 1 (month) response?

    Any help would be greatly appreciated.

    Thank you

    Yes, you use the date object JavaScript extract fields of the whole of the year and the month, create a common denominator for the month and year, and do the math.

    The event of calculation for the number of months:

    Delete the result value

    Event.Value = "";

    get field values

    var sStart = this.getField("Date1").value;

    Send var = this.getField("Date2").value;

    process if we have data

    If (sStart! = "" & send!) = "") {}

    convert date objects date strings

    var start = util.scand ("mmm yyyy", sStart);

    oEnd var = util.scand ("mmm yyyy", sending);

    get the full date and month year beginning

    var nStartFullYear = oStart.getFullYear ();

    var nStartMonth = oStart.getMonth ();

    convert data from start of month

    var nStartMonths = (nStartFullYear * 12) + nStartMonth;

    Get the complete year end date and month

    var nEndFullYear = oEnd.getFullYear ();

    var nEndMonth = oEnd.getMonth ();

    convert data from end of month

    var nEndMonths = (nEndFullYear * 12) + nEndMonth;

    do the math

    Event.Value = nEndMonths - nStartMonths;

    } / / end have given

    You will need to adjust the names for the start and end dates.

  • I would like to spelling to reflect the American English spelling English not British.

    When I use LibreOffice Writer, the spell checker uses American English. When I'm in Firefox, however, the spell checker uses British English, i.e. favorite favorite instead. Firefox used to spell according to American English. I would like to convert back to American English. Please tell me how to do this.

    If you select a dictionary then Firefox to remember the choice and you should always have this dictionary selected on next start

    If you don't keep changes after a reboot then see:

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the start safe mode window or make changes.
  • the keyboard layout does not change stuck in American English.

    Original title: stuck in American English

    I was using my laptop with the keyboard moving between French or British English that I didn't ask, no problem this morning. Now he has decided to keep on American English, no matter what language, the taskbar says he uses. I did not put that American English is at all today. Help, please!

    Thank you, but have been there, what did somehow.
    Did not any changes that I knew. Also had bees through the diagnostic steps suggest you, but not joy. My husband has finally solved the problem: he found a small icon (somewhere lower right scale) that looks like a keyboard and it was worth it-set to U.S. English, but where he found I do not have a clue and have never managed to find since!

  • Need to remove American English from the language bar, but cannot do. __

    I use IME to enter Japanese text. It is also includes the possibility to type in englist, another Englishman in the language bar is not necessary. But even if I delete if, after restarting it's again. He only appears in the list of the language bar, and then in the settings of language ("text Services and input languages"), it is not presented.
    To remove it from the lanbuage bar, do the following: add some English in the "text Services" and input languages window-> changes-> remove it-> the parameters applied. But it works only until the next reset.
    I also had the same problem on Windows XP before.

    Where is the problem?

    I have 2 accounts: 1 Administrator and 1 user. Both accounts have the same problem.
    On the home screen, everything is OK (there are no English in the list).
    Side for Japanese (IME), I also have the Russian in the language list, so when there also English in this list, it makes it really difficult to switch between languages using a keyboard shortcut.

    I use IME to enter Japanese text. It is also includes the possibility to type in englist, another Englishman in the language bar is not necessary. But even if I delete if, after restarting it's again. He only appears in the list of the language bar, and then in the settings of language ("text Services and input languages"), it is not presented.
    To remove it from the lanbuage bar, do the following: add some English in the "text Services" and input languages window-> changes-> remove it-> the parameters applied. But it works only until the next reset.
    I also had the same problem on Windows XP before.

    Where is the problem?

    I have 2 accounts: 1 Administrator and 1 user. Both accounts have the same problem.
    On the home screen, everything is OK (there are no English in the list).
    Side for Japanese (IME), I also have the Russian in the language list, so when there also English in this list, it makes it really difficult to switch between languages using a keyboard shortcut.

    Somethings happening certainly with the language bar in Windows 7 RTM (7600).

    My Setup was quite with English UK.
    Today, I had the language bar appear suddenly on the taskbar without apparent reason. When I clicked on the language bar, he revealed to British and AMERICAN English.

    I checked in Control Panel > regional settings and parameters of UK are the only ones to be installed. US English is not there at all under 'keyboard and languages' or annywhere elsewhere in the applet. Despite this, I couldn't have the language bar to stop showing the choice between UK a U.S..  the locale system are set to UK, as are the default values for new user profiles. Language of the United States seemed not anywhere in the applet in the Control Panel, because I created just like UK during the installation of the OS. (it was a clean install, not upgrade)

    US English should not be able to appear at all in the language bar, given that American English is not installed in the list of languages in the locale. The only language installed is English UK. Surely I would not see the language bar, if I only have one set of language and regional settings installed?

    In the end, I could solve the problem by adding in the American language in "keyboards and languages", apply the settings and then recede in the locale and removing the American language again. After you apply these settings again, the language bar is now gone again.

    But the parameters resulting in the Panel are no different from how they were in first place.

    This is not a show-stopper, but will be very boring if it continues to be. I'll post back if it isn't

    B

  • the 4.0 library software (cambridge American English Dictionary) can be installed, but cannot be run

    I have the Library 4.0 software (cambridge American English Dictionary). It was installed on my computer, but it cannot be performed then, it appears only an annoying empty window showing nothing. How can I looked at me? -I have windows 7 - please help I have to take a very difficult English exam

    Check under help & support to "Compatibility" and try the various compatibility options listed

    http://Windows.Microsoft.com/en-us/Windows-Vista/make-older-programs-run-in-this-version-of-Windows

Maybe you are looking for

  • HP Color LaserJet 4550: HP Color LaserJet 4550 PCL XL error

    I use this printer for years.  It works beautifully. Windows 10 has just done an update & the printer driver disappeared.  I use this printer with a HP Jet Direct J4135A usb card.  Now any driver or what I do I try to install or use, I get the same e

  • Laser jet CM2320fxi: USB3

    My laptop has only USB3 connections. When you try to install the driver on the laptop to the printer, it does not for the scanner. He asked USB 2 connection. Printer is connected by a network cable. How can I by bass this burden so I can finish the i

  • Data compiled instantly lighting from front panel?

    It's really only for the looks, but I was wondering if there was a way to collect and convert them into two different types, instantly on the front panel. We'll use hexadecimal or binary, because that's what I collect. I have a huge variety of number

  • Reset the XY graph

    Hello I have a problem with my graph xy, the program receives the data from the excel files and he made several operations after that, I send the results to a xy chart, now I'm trying to reset the graph each 100 iteration to avoid saturation of the d

  • Unable to get the Windows installation on the reboot of the CD player.

    I want to reformat my hard drive (c :) and reinstall windows xp.) I changed my BIOS to boot from CD, put my Windows XP installation disc in the drive and rebooted the PC.  On it reboot asked to hit any key to boot from CD I made. I expected to see th