This topic is locked
[SOLVED]

  Military Time

8/10/2010 2:46:46 PM
PHPRunner General questions
swant author

Is there a way to display military time instead of am or pm times in the databases? Is this determined by mysql or php code? And also i would like to just display the month and year also instead of the full date

A
ann 8/11/2010

Hi,
you can display the date in any desired format. Use custom type on the View as settings dialog on the Visual Editor tab.

Here is a sample:

$value = date("h:i:s F Y",$value);



More info here:

http://php.net/manual/en/function.date.php

swant author 8/11/2010

So ive tried this, with the code snip as suggested, witht the php settings that i would like $value = date("H:i:s F Y",$value);
here's what the message is in the main database
have I inputted the value wrong or put it in the incorrect place, im going to editor > then clicking on my field > go to custom and putting $value = date("H:i:s F d Y",$value); > check syntax checks ok
8

Error description A non well formed numeric value encountered

URL info/DeliveryRR/Delivery_Room_Registry_list.php?

Error file /srv/www/htdocs/DeliveryRR/include/phpfunctions.php

Error line 552

SQL query SELECT DeliveryReg, Month/Year, `Delivery#, Patient_Last_Name, First_Name,Room_#, Admit_Date_Time,MedRec#, GEST_Period,G/P, Presentation, Membranes_Ruptured, Operative_Intervention, Deilvery_Date_Time,Episiotomy_&_Repair, Placenta,BabyTag#, Sex,APGAR's,WT., Length, Rh_Factor,Newborn_Med_Rec#, Oxytocic_Drugs, Complications, Anethesia_Type, Anesthesiologist, Nurse_1, Nurse_2, OB_MD_1,Ped's_FP,Ped's_MD_2_BC/CC/RS`, Last_Person_to_Modify, Induction, Augmentation FROM Delivery_Room_Registry ORDER BY 1 ASC
more info

0. include/phpfunctions.php:552 date 1. H:i:s F d Y;

  1. 2010-08-10 19:00:00;

    1. include/phpfunctions.php:552 CustomExpression 1. 2010-08-10 19:00:00;


  2. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;
  3. Admit_Date_Time;
  4. ;

    2. include/commonfunctions.php:855 GetDataInt 1. 2010-08-10 19:00:00;


  5. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;
  6. Admit_Date_Time;
  7. Custom;

    3. include/commonfunctions.php:845 GetData 1. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;


  8. Admit_Date_Time;
  9. Custom;

    4. classes/listpage.php:2411 ListPage->proccessRecordValue 1. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;


  10. &key1=4;
  11. Array ( [fName] => Admit_Date_Time [goodFieldName] => Admit_Date_Time [valueFieldName] => Admit_Date_Time_value [styleFieldName] => Admit_Date_Time_style [viewFormat] => Custom ...;

    5. classes/listpage.php:2105 ListPage->fillGridData N/A

    6. classes/listpage.php:2624 ListPage->prepareForBuildPage N/A

    7. Delivery_Room_Registry_list.php:90 Global scope N/A




    Hi,
    you can display the date in any desired format. Use custom type on the View as settings dialog on the Visual Editor tab.

    Here is a sample:



$value = date("h:i:s F Y",$value);



More info here:

http://php.net/manual/en/function.date.php

swant author 8/11/2010

also on a side note if i delete all the data in the table and start new it works to see that there is nothing there, however when i add things the time date shows up like i want it but as soon as i go back to themain table i get those same error messages again.



So ive tried this, with the code snip as suggested, witht the php settings that i would like $value = date("H:i:s F Y",$value);
here's what the message is in the main database
have I inputted the value wrong or put it in the incorrect place, im going to editor > then clicking on my field > go to custom and putting $value = date("H:i:s F d Y",$value); > check syntax checks ok
8

Error description A non well formed numeric value encountered

URL info/DeliveryRR/Delivery_Room_Registry_list.php?

Error file /srv/www/htdocs/DeliveryRR/include/phpfunctions.php

Error line 552

SQL query SELECT DeliveryReg, Month/Year, `Delivery#, Patient_Last_Name, First_Name,Room_#, Admit_Date_Time,MedRec#, GEST_Period,G/P, Presentation, Membranes_Ruptured, Operative_Intervention, Deilvery_Date_Time,Episiotomy_&_Repair, Placenta,BabyTag#, Sex,APGAR's,WT., Length, Rh_Factor,Newborn_Med_Rec#, Oxytocic_Drugs, Complications, Anethesia_Type, Anesthesiologist, Nurse_1, Nurse_2, OB_MD_1,Ped's_FP,Ped's_MD_2_BC/CC/RS`, Last_Person_to_Modify, Induction, Augmentation FROM Delivery_Room_Registry ORDER BY 1 ASC
more info

0. include/phpfunctions.php:552 date 1. H:i:s F d Y;

  1. 2010-08-10 19:00:00;

    1. include/phpfunctions.php:552 CustomExpression 1. 2010-08-10 19:00:00;


  2. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;
  3. Admit_Date_Time;
  4. ;

    2. include/commonfunctions.php:855 GetDataInt 1. 2010-08-10 19:00:00;


  5. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;
  6. Admit_Date_Time;
  7. Custom;

    3. include/commonfunctions.php:845 GetData 1. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;


  8. Admit_Date_Time;
  9. Custom;

    4. classes/listpage.php:2411 ListPage->proccessRecordValue 1. Array ( [DeliveryReg] => 4 [Month/Year] => 2010-08-06 [Delivery#] => 1234 [Patient_Last_Name] => swan [FirstName] => thad [Room#] => 1 [Admit_Date_Time] => 2010-08-10 1...;


  10. &key1=4;
  11. Array ( [fName] => Admit_Date_Time [goodFieldName] => Admit_Date_Time [valueFieldName] => Admit_Date_Time_value [styleFieldName] => Admit_Date_Time_style [viewFormat] => Custom ...;

    5. classes/listpage.php:2105 ListPage->fillGridData N/A

    6. classes/listpage.php:2624 ListPage->prepareForBuildPage N/A

    7. Delivery_Room_Registry_list.php:90 Global scope N/A




A
ann 8/12/2010

Hi,
try the following code:

$value = date("h:i:s F Y",strtotime($value));



If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.

swant author 8/12/2010

Yes that did it thank you <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51831&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />
It was a missing parentheses in the original also strtotime which i didnt see anywhere on the php site at least the one suggested., guess its time to lear php a little better to see that kind of thing
once again thank you super big help



Hi,
try the following code:

$value = date("h:i:s F Y",strtotime($value));



If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.