Conversion of TimeStamp can be used as

I've been using this script, which seems to be everywhere on the web, but get a different date for what is in my database:

<? PHP {? >}

< h3 > <? PHP echo $row_GetsNewsText ['post_title'];? > < / h3 >

<? PHP $datetime = $row_GetsNewsText ['post_date'];

$year = substr ($datetime, 0, 4);

$mon = substr ($datetime, 4, 2);

$day = substr ($datetime, 6, 2);

$hour = substr ($datetime, 8, 2);

$min = substr ($datetime, 10, 2);

$sec = substr ($datetime, 12, 2);

$orgdate = date ("F jS, Y", mktime ($hour, $min, $sec, $mon, $day, $year));

  ?>

< h4 > <? PHP echo $orgdate;? > <? PHP / *? > <? PHP echo $row_GetsNewsText ['post_date'];? > <? PHP * /? > < / h4 >

< p > <? PHP echo $row_GetsNewsText ['post_content'];? > < / p >

<? PHP} while ($row_GetsNewsText = mysql_fetch_assoc ($GetsNewsText));? >

I do not understand concerning the ORDER of the variables in $orgdate? I tried in different orders, which has varying effects, so this must be the key, I guess that?

The two entries MUST show:

January 8, 2010-June 15, 2010

But what I get is:

December 1, 2009-December 6, 2009

I keep seeing January = 1 and June = 6, so we can assume I get close?

I'm sure it's something obvious, but can't find it.

This script appears only if it is based on the way the MySQL timestamps were formatted in MySQL 3.23 and 4.0.

The old time stamp looked like this: 20101127204235.

The same timestamp MySQL 4.1 looks like this: 2010-11-27 20:43:35.

So you get the wrong timestamp with substring() definitions parts.

However, if you use PHP 5.2 or 5.3, you can do it much more simply:

$datetime = new DateTime($row_GetsNewsText['post_date']);
$orgdate = $datetime->format('F jS, Y');

Tags: Dreamweaver

Similar Questions

  • The WCChromeExtn file does not exist in the Acrobat folder, so that I can't use the extension of the conversion of PDF in Chrome.

    I installed Acrobat Pro 11.0.10. The WCChromeExtn file does not exist in the Acrobat folder, so that I can't use the extension of the conversion of PDF in Chrome.

    I do not know how to find this file, but it worked after the repair! Thank you.

  • Conversion: Can I use Corel WordPefrect 8 data with Windows Vista files?

    Can I use data files Corel WordPefrect 8 with Windows Vista?

    On Friday, June 11, 2010 17:03:40 + 0000, grandmadfs wrote:
     
    > Can I use Corel WordPefrect 8 data with Windows Vista files?
     
     
     
    The issue here is not one of which version of Windows you are using.
    It is one of what you have installed applications.
     
    The answer is Yes, if you have WordPerfect (or some compatible)
    program) installed on Windows Vista. The answer is no, if you do not.
     
     
    Ken Blake, Microsoft MVP (Windows desktop experience) since 2003
     

    Ken Blake

  • I can't use my iphone!

    I closed my account and I don't remember the security question, because I've created four years ago! Add to that my account when * isn't it in the outlook as receive or send messages. (Microsoft Office)! What should I do?.... Now, I worked hard reset the phone asking me to identify you. APPLE ID for the same e-mail, which has been closed to you! I'm tired of this suffering can not use my iphone at all! What is this Apple of complexity!

    < Email published by host >

    Hi Maryamjaber,

    It is not Apple, but a forum for users to help and help other users.

    If you state your problem clearly and correctly, other users like you, help you with your problem so that you can use your product without problem.

    Is best to clearly and unambiguously to state exactly your problem, your configuration and history as much as possible on the thread and someone might be able to offer assistance or advice. Otherwise, you are free to make an appointment at the Genius Bar or your nearest Apple Store.

    Complaints and other things, is best achieved by the manufacturer and is not really its place in our conversations. Nobody here is officially from Apple or Apple Store.

    We hope that your issue is resolved very quickly.

    PS. I asked your message to be moved to the appropriate forum.

    Leo

  • Hello from Firefox can be used for three or more way call or is it only from person to person?

    Hello from Firefox can be used for three or more way call or is it only from person to person?

    Hi awilcox Hello firefox time can only be used for a direct conversation between two people.

  • How to convert an mp3 file to a file rtext? Can I use windows media player to play mp3 and have the recigition speech to convert to text?

    Can I use windows media player to play mp3 and have the recigition speech to convert to text?

    You can get on a conversion of 70% in reading a file in Windows Media Player using something like Dragon Naturally Speaking to convert. If you set the playback speed to slow in Windows Media Player to play > play speed, you will get a better result. The best option is to download the file to an audio transcription service, but which generally costs 0, 50-1, 00 per minute of audio.

  • Cisco AIR-CAP3502I-A-K9 can be used in standalone mode?

    Hello

    We strive to deploy AIR-CAP3502I-A-K9 with 5508 controller. However, the controller is remaining and we do not want to delay our site survey. Can we use the AP mode stand-alone for the poll on the site? We don't need to exploit or to pass traffic. As long as he can feed himself which is detected by Ekahau Site survey tool, I'm fine. I can power via a PoE switch.

    Thank you

    You can use it as a regular standalone access point without restriction. Need to download this code and convert CAPWAP IOS autonomous Yould:

    ap3g1-k9w7 - tar.124 - 25d.JA.tar

    You can find instructions how to do the conversion on the Cisco site

  • Unable to take backup on Windows 7 get error code 0 x 81000019 and message backup Windows found errors on the media during a backup on it and can't use it for additional backups.

    Original title: backup Windows found errors on the media during a backup.

    original title: backup errors

    Whenever I try to do my monthly backup I get the following messages

    Backup Windows found errors on the media during a backup on it and can not use it for additional backups.

    Pleas write the following label on a blank media and insert it into D: /.

    I did and then he asked me to get in shape, I say OK and I get the same message on the media errors and I put another disc and get the same problems again. I can't find out what the problem is, what can I do to fix this problem and get a new backup?

    I now have an error 0 x 81000019

    Hello

    You did changes to the computer before the show?

    Method 1: Check if the shadow copy volume is running
    (a) click Start.
    (b) in the search box, type Services.msc.
    shadow copy Volume c) right-click and go to properties.
    (d) select Auto (Delayed) in the start menu type in the menu drop-down.

    Method 2: Clean boot
    When the computer starts to boot, programs non-Microsoft will not be started and would avoid any interruption of their share.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.microsoft.com/kb/929135.

    Note: Once you are done with the boot, follow step 7 of article to reset your computer to normal startup.

    Method 3:

    Check all your drives to NTFS.

    This problem may occur if the drive is not NTFS format.

    Please follow the steps mentioned below to convert the reader:

    Using the Convert command

    1. click on the "Start" button, click "all programs" and click on "Accessories".

    2. right click on "command prompt" and click "run as administrator".

    3. in the window "Administrator: command prompt", type the following command and press ENTER.

    CONVERT %Drive% letter: / FS: NTFS

    letter of %Drive% is the driver that you want to convert. For example, type the following command to convert drive F to NTFS:

    CONVERT F:/FS: NTFS

    4. when the following message appears in the command prompt window, type the volume label of the drive that you are converting, and then press ENTER:

    The type of the file system is FAT.

    Enter the name of the current volume of reader letter %Drive%:

    Type any string of characters for the Volume name. If you simply press ENTER, it will affect 'Local disk' as the default Volume name.

    5. when the conversion to NTFS is complete, the following line appears in the command prompt window:

    "Complete conversion".

    6. restart the computer and check the result.

    Hope this information is useful.

  • I have a problem with the payment: (why charge me 44,99 EUR (cost 61.99 euros) then block system and I can't use the programs :(

    I have a problem with the payment why charge me 44,99 EUR (cost 61.99 euros) then block system and I can't use programs

    Please click Accounts & billing link here https://helpx.adobe.com/contact.html to have a conversation with our billing support team.

    Thank you

    Stéphane

  • can I use old .its session files in the new hearing?

    can I use old .its session files in the new hearing?

    Not directly, no - but there is a way you can import:

    Ses2sesx - block hearing/CEP Conversion utility

  • I ve just to open a PDF file in Word format, but I can't use it properly. The document is unformated...

    I ve just to open a PDF file in Word format, but I can't use it properly. The document is unformated...

    The conversion to WORD (if you converted before you opened in WORD, because WORD does not open PDF files to my knowledge) is a luck of the draw. Two options are generally available, to keep the page layout and to maintain the flow of the text. The provision creates a bunch of text boxes in WORD with your information. The stream format does not text boxes. If the PDF file has been create from WORD with all tags (using PDF Maker), then the conversion can be almost flawless. If it was printed to PDF format or the markup turned off, then you are function Acrobat (or export) try to interpret what is necessary and the results is often not great. An article that almost never comes out right are equations.

    If you scanned the document, then you have an OCR option, but don't expect great things. You must always keep the originals of your documents. Reverse engineering function, a PDF to WORD is a dangerous practice.

  • Can I use adobe pdf on an imac export? [was: brian newcombe]

    Can I use adobe pdf on an imac export?

    Hi Brian,.

    Welcome to the Adobe Forum,

    ExportPDF is an online conversion program. It is not dependent on OS. You can use this service anywhere. Need you just an internet web browser and connection work.

    I would like to know if you have any further questions.

    Concerning

    Baudier

  • can we use to_date using Union or Union

    Hi, while I do any union with two tables I get

    ORA-01790: expression must have same type of data, matching expression
    01790 00000 - "expression must have the same type of data, matching expression.


    and if I change this data type of TO_CHAR is showing correct result

    SELECT (TO_CHAR (C61_CURRENT_MONTH, ' MON-DD-YYYY "") CURRENT_MONTH EDW.) C$ _0VW_TEMP_PLAYER_DTL_LOAD
    UNION ALL
    SELECT (TO_CHAR (C17_CURRENT_MONTH, ' MON-DD-YYYY "") CURRENT_MONTH EDW.) C$ _1VW_TEMP_PLAYER_DTL_LOAD

    and I'm going to insert this result in a table which column is defined as the DATE data type

    so I tried below one as

    Select to_date (TO_CHAR (C61_CURRENT_MONTH, ' MON-DD-YYYY ""), 'dd-mon-yyyy') CURRENT_MONTH OF EDW. C$ _0VW_TEMP_PLAYER_DTL_LOAD
    UNION ALL
    TO_DATE (TO_CHAR (C17_CURRENT_MONTH, ' MON-DD-YYYY ""), 'dd-mon-yyyy') CURRENT_MONTH OF EDW. C$ _1VW_TEMP_PLAYER_DTL_LOAD

    but I get the error message like

    ORA-01790: expression must have same type of data, matching expression

    so my question is can we use to_date using union all.

    Maybe do you the conversion to remove time from date values.

    This could be done better with:

    select trunc(C61_CURRENT_MONTH) CURRENT_MONTH FROM EDW.C$_0VW_TEMP_PLAYER_DTL_LOAD
    UNION ALL
    select trunc(C17_CURRENT_MONTH) CURRENT_MONTH FROM EDW.C$_1VW_TEMP_PLAYER_DTL_LOAD
    

    I can't reproduce your original error, because I do not have your tables (test data would be nice)
    and no doubt I'm on another database-version (we do not know your version of db).

    Published by: hm on 19.04.2012 04:30

  • How HRMS API can be used to hire a Contact?

    In 11i and/or R12.1.3, who knows what (s) HRMS API can be used to hire a contact? In other words, a "person" that exists in the system but is not a former employee, for example, someone of the spouse or child. He is a person who exists in PER_ALL_PEOPLE_F, with one SYSTEM_PERSON_TYPE of OTHERS. We do not use iRec or any feature of the applicant, so I cannot create an application for the Contact, and then hire the applicant. Instead, my requirement is to directly hire Contact.

    I am using the following APIs for other scenarios, but did not understand the rental Contact yet:

    HR_EMPLOYEE_API. CREATE_US_EMPLOYEE - using this API for hires of the brand that do not currently exist in the database
    HR_EMPLOYEE_API. RE_HIRE_EX_EMPLOYEE - using this API for rehire of former employees who already exist as a person in the database

    A note more, I'm able to accomplish this task without any problem from the front end, so I think there must be a way to do the same for the back-end.
    for example,.
    1) go to the form of the person
    (2) find Contact
    (3) change the Action to "create jobs".
    (4) choose the Type Person "employee."
    (5) record, which rents the Contact and creates the employee successfully record

    Help, please!

    Thank you
    Jason Genovese

    Hello

    Don't know what version you are, but 11.5.10.2, the hire_into_job procedure is an overloaded procedure - looking at the comments in the header, which allows the conversion of types of 'OTHER' is one that has p_assignment_id as the OUT parameter

    Hope this helps

    Clive

    * Edited to add - looks like our cross messages! Good luck...

    Published by: clive_t on March 23, 2012 11:35

  • Date of submission to the conversion of TIMESTAMP variable

    Hello
    I have a date database table id column, a quick date with calendar and I need to show the number of days between the DATE_COLUMN and PROMPT_VALUE.
    I am selected storage prompt value in variable presentation PROMPT_DATE.
    I think, I need to use the TIMESTAMPDIFF function, but I have this problem:

    TIMESTAMPDIFF (SQL_TSI_DAY, DATE_COLUMN, ANOTHER_DATE_COLUMN) is OK

    but

    TIMESTAMPDIFF (SQL_TSI_DAY, DATE_COLUMN, CAST (' @{PROMPT_DATE}' as DATE))

    I got the error:

    [nQSError: 10058] A general error occurred. [nQSError: 46046] 01/04/2000 DateTime value does not match the specified format. (HY000) (...... TIMESTAMPDIFF (SQL_TSI_DAY, periods. ((' ' Month ', cast (' 01 / 04/2000 ' as date))...)

    I Don t know how to convert variable date of presentation by TIMESTAMP or another format, that I can use in TIMESTAMPDIFF function.

    I have an idea, but I'd like to find another solution. One solution might be to analyze variable presentation string, substring pieces 3 per day, mount, year and concat that parts in a single string, which can be used in TIMESTAMP call
    But I'm having a problem with the format of date and places. For example, in English, I'll have jj/mm/aaaa mask, in another language, I will have exact mask

    Can you help me?

    EVALUATE ("(%1, %2) TO_DATE', 'variable @dashboard',' the date format of the variable of dashboard")

Maybe you are looking for

  • How to recover the music Apple folder in iTunes?

    I just nuked my Mac and copied my username on an external drive first folder. Music bought and torn is in place but I can't the files downloaded music Apple back on the computer. It seems that it is something, but the number of songs does not change.

  • Noisy fan on Satellite Pro A100

    I bought this laptop last year Oct and it seems a bit buggy now. Sometimes the system just hang out like that... I was surfing at halfway and the system just block without reason. I haven't run any software... It is rarely happen, but it happened to

  • Envy x 360 laptop: HP Notebook System Bios update system (Intel processors) could not be updated

    I get an error of update failed trying to imstall the next update: HP Notebook System Bios update system (Intel processors) Impossible to update Is there a way to properly update this? What is a critical update? Thank you Anthony

  • Can I use restore with disk CD external non-Toshiba - Portege R100?

    Hello I'm trying to recover a Portege R100. Y at - it another way to do it rather than using a player "Recommended Toshiba", I already have three external drives and don't really see any point in buying another. Any help would be appreciated Nick

  • My laptop is not put into hibernation

    I get the message Alp your pointing device prevents the system to Hibernate. If the problem reoccur, so far the pilot.I try to update, but there is not available so far.I had the same problem on my previous Satellite.Any suggestion?