WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<?php// setting the format$d->format="%A, %d. %B %Y";// This will return the date-string in the given format.// e.g. below: 11. März 1966$d->transform ("11/03/1966");// This will return the current time in the format.$d->toHTML();// This also$d->toHTML ( TIME() );// This will set a new Language, e.g. italy.$d->setLanguage ( array ("it_IT", "italiy", "it_IT@euro") );// This will change all dates in a given string (pass by reference!).$d->parse_string ("At 30.01.1998 the new book of Mr. Unknown comes ...");// Testing a given language-key agains the locales and optional use them.// Returns a list with all matches.$all = $d->test_locale("de_AT", true);foreach ($all as $tempKey) echo "< br />".$tempKey; // will result in:de_ATde_AT.ISO8859-1de_AT.ISO8859-15de_AT.UTF-8?>
<?php// Convert the unix ts for modified_when to human a readable formif($results_array['modified_when'] != 0) { /** * Modify by Dietrich Roland Pehlke - aldus * * @ersion 0.1.0 * @date 2008-08-19 * * Testing the use of x_cDate in the backend */ $temp_path = WB_PATH."/modules/x_cdate/include.php"; if (file_exists($temp_path)) { require_once($temp_path); $d = new c_date(); $d->set_wb_lang( LANGUAGE ); $d->format="<br />%A, %d. <font style='color:#900;'>%B</font> %Y -%H:%I:%S<br />"; $modified_ts = $d->toHTML( $results_array['modified_when']+TIMEZONE ); } else { $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE); }} else { $modified_ts = 'Unknown';}?>
<?php$d = new c_date();/*** Changing the current format*/$d->format="%A, %d. <font style='color:#900;'><i>%B</i></font> %Y<br />";echo $d->toHTML() ;echo $d->transform("11/03/1966");echo $d->transform("11.03.1966") ;echo $d->transform("03-11-1966", 'm-d-y') ;echo $d->transform("1966-03-11", 'y m D') ;echo $d->transform("1966/03/11", 'ymd') ;echo $d->transform("03/11/66", CDATE_USE_MDY) ;echo $d->set_wb_lang("EN");echo $d->toHTML() ;$str = "<br><br>On 11.03.1998 Mr. Unkown has shown his new book »Anastasitica« inside his office.<br>";$str .= "And on 03.06.2008 we will read it!<br />";$d->parse_string($str);echo $str;$a = $d->test_locale("de_AT", false);foreach ($a as $t) echo "<br />".$t;echo "<br /><br />".$d->transform("11.01.66");?>
<?php // A: Get the entry date and time // MODIFICATION by Stefek to alternate the Date Output in the frontend // using cDate Module by Aldus --> // Workout date and time of last modified post $temp_path = WB_PATH."/modules/x_cdate/include.php"; if (file_exists($temp_path)) { require_once($temp_path); $d = new c_date(); $d->set_wb_lang( LANGUAGE ); ////put your HTML/CSS alteration of the output into the next line $d->format="<div class='calender'><br /><span class='m'>%B<br /></span><span class='d'>%d<br /></span><span class='y'>%Y</span></div>"; $entry_date = $d->toHTML( $entry['posted_when']+TIMEZONE );} else { $entry_date = gmdate(DATE_FORMAT, $entry['posted_when']+TIMEZONE); } $entry_time = gmdate(TIME_FORMAT, $entry['posted_when']+TIMEZONE); /*$entry_date = gmdate(DATE_FORMAT, $entry['posted_when']+TIMEZONE); $entry_time = gmdate(TIME_FORMAT, $entry['posted_when']+TIMEZONE); */?>
Directoryindex index.php , index.htm, index.htmlAddType application/x-httpd-php5 .php .php4 .php3 .php5
de_DE
de_DE.UTF-8
<?php/* 1 */ $oDate = new c_date();/* 2 */ /* 3 */ $all = $oDate->test_locale( "de_DE" );/* 4 */ /* 5 */ $oDate->setLanguage(/* 6 */ array_reverse($all)/* 7 */ );/* 8 */ $oDate->format= "%d %B %Y";/* 9 */ /* 10 */ echo $oDate->toHTML( time()-( 60*60*24*60) );?>
<?php/* 1 */ $oDate = new c_date();/* 2 */ /* 3 */ $oDate->setLanguage( array (/* 4 */ 'de_DE.UTF-8',/* 5 */ 'de_DE',/* 6 */ 'de_DE@euro'/* 7 */ )/* 8 */ );/* 9 */ $oDate->format= "%d %B %Y";/* 10 */ /* 11 */ echo $oDate->transform( "11.03.1966" );?>