当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Date::getIso方法代码示例

本文整理汇总了PHP中Zend_Date::getIso方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Date::getIso方法的具体用法?PHP Zend_Date::getIso怎么用?PHP Zend_Date::getIso使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Date的用法示例。


在下文中一共展示了Zend_Date::getIso方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $this->setMethod('post');
     $this->addElement('RadioButton', 'type', array('label' => 'Tipo di inserimento:', 'multiOptions' => array('OFFER' => 'Offerta passaggio', 'NEED' => 'Richiesta passaggio'), 'value' => 'NEED', 'onClick' => 'rideTypeChange(this);'));
     $this->addElement('RadioButton', 'repeatable', array('label' => 'Questo inserimento è valido:', 'multiOptions' => array(0 => 'Una volta soltanto', 1 => 'Periodicamente'), 'value' => 0, 'onClick' => 'rideDateChange(this);'));
     $date = new Zend_Date();
     $this->addElement('DateTextBox', 'date', array('label' => 'Data di partenza:', 'required' => false, 'value' => $date->getIso()));
     $this->addElement('multiselect', 'weekdays', array('label' => 'Giorni di validità:', 'required' => false, 'multiOptions' => array('MONDAY' => 'Lunedì', 'TUESDAY' => 'Martedì', 'WEDNESDAY' => 'Mercoledì', 'THURSDAY' => 'Giovedì', 'FRIDAY' => 'Venerdì', 'SATURDAY' => 'Sabato', 'SUNDAY' => 'Domenica'), 'size' => 5, 'multiple' => true));
     $this->addElement('NumberSpinner', 'num_spots', array('label' => 'Posti disponibili:', 'value' => 3, 'smallDelta' => 1, 'min' => 0, 'max' => 10));
     $this->addElement('Textarea', 'purpose', array('label' => 'Motivo del viaggio:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(1, 255)))));
     $this->addDisplayGroup(array('type', 'repeatable', 'purpose'), 'insertion_type', array('legend' => 'Inserimento offerta'));
     $this->addDisplayGroup(array('date'), 'ride_date', array('legend' => 'Data'));
     $this->addDisplayGroup(array('weekdays'), 'ride_days', array('legend' => 'Periodo'));
     $this->addDisplayGroup(array('num_spots'), 'ride_spots', array('legend' => 'Dettagli offerta'));
     $db = Zend_Db_Table::getDefaultAdapter();
     $values = $db->fetchPairs("SELECT code, name FROM Municipality");
     //Departure town
     $this->addElement('FilteringSelect', 'dep_municipality', array('label' => 'Inserisci il comune di partenza:', 'autocomplete' => false, 'multiOptions' => $values, 'validators' => array(array('validator' => 'StringLength', 'options' => array(6, 6))), 'required' => false, 'onChange' => 'fetchTowns(this,"dep");'));
     $this->addElement('FilteringSelect', 'dep_town', array('label' => 'Inserisci la località di partenza:', 'autocomplete' => false, 'storeId' => 'depTownStore', 'storeType' => 'dojo.data.ItemFileReadStore', 'storeParams' => array('clearOnClose' => true), 'dijitParams' => array('searchAttr' => 'name')));
     //Departure time
     $this->addElement('TimeTextBox', 'dep_time', array('label' => 'Orario di partenza:', 'required' => true, 'value' => $date->getIso(), 'clickableIncrement' => 'T00:15:00', 'visibleIncrement' => 'T00:15:00'));
     $this->addDisplayGroup(array('dep_municipality', 'dep_town', 'dep_time'), 'departure', array('legend' => 'Partenza'));
     //Arrival town
     $this->addElement('FilteringSelect', 'arr_municipality', array('label' => 'Inserisci il comune di arrivo:', 'autocomplete' => false, 'multiOptions' => $values, 'validators' => array(array('validator' => 'StringLength', 'options' => array(6, 6))), 'required' => false, 'onChange' => 'fetchTowns(this,"arr");'));
     $this->addElement('FilteringSelect', 'arr_town', array('label' => 'Inserisci la località di arrivo:', 'autocomplete' => false, 'storeId' => 'arrTownStore', 'storeType' => 'dojo.data.ItemFileReadStore', 'storeParams' => array('clearOnClose' => true), 'dijitParams' => array('searchAttr' => 'name')));
     //Arrival time
     $this->addElement('TimeTextBox', 'arr_time', array('label' => 'Orario di arrivo:', 'required' => true, 'value' => $date->getIso(), 'clickableIncrement' => 'T00:15:00', 'visibleIncrement' => 'T00:15:00'));
     $this->addDisplayGroup(array('arr_municipality', 'arr_town', 'arr_time'), 'arrival', array('legend' => 'Arrivo'));
     $this->addElement('submit', 'submit', array('label' => 'Inserisci'));
 }
开发者ID:Kjir,项目名称:carpond,代码行数:30,代码来源:Insert.php

示例2: indexAction

 /**
  * indexAction lists available messages and allows to send a message to someone else
  */
 public function indexAction()
 {
     $form = $this->_getMessageForm();
     $username = $this->_getParam("username");
     if (!empty($username)) {
         $form->getElement("username")->setValue($username);
     }
     require_once APPLICATION_PATH . "/model/Message.php";
     $table = new Message();
     $messages = $table->fetchAll($table->select()->from($table, array('id', 'date', 'sender', 'subject'))->where('receiver = ?', Zend_Auth::getInstance()->getIdentity()->username));
     $this->view->messages = $messages->toArray();
     if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
         $values = $form->getValues();
         $date = new Zend_Date();
         $data['date'] = $date->getIso();
         $data['subject'] = $values['subject'];
         $data['text'] = $values['message'];
         $data['sender'] = Zend_Auth::getInstance()->getIdentity()->username;
         $data['receiver'] = $values['username'];
         $table->insert($data);
         $this->_helper->redirector('index', 'message', 'default', array('sent' => true));
     }
     $this->view->messageSent = $this->_getParam('sent');
     $this->view->messageDeleted = $this->_getParam('deleted');
     $this->view->form = $form;
 }
开发者ID:Kjir,项目名称:carpond,代码行数:29,代码来源:MessageController.php

示例3: dateLocalToCustom

 /**
  *
  * @param type $dateStr
  * @param type $format
  * @return type 
  */
 public static function dateLocalToCustom($dateStr, $format = '')
 {
     $date = new Zend_Date($dateStr);
     if ($format != '') {
         return $date->toString($format);
     } else {
         return $date->getIso();
     }
 }
开发者ID:bokultis,项目名称:kardiomedika,代码行数:15,代码来源:Date.php

示例4: getForm

 public static function getForm()
 {
     Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
     $form = new Zend_Form();
     $form->setDecorators(array(array('ViewScript', array('viewScript' => 'editor/changesForm.phtml'))));
     $zdate = new Zend_Date();
     $e = new Zend_Dojo_Form_Element_DateTextBox('fromDate', array('label' => 'From', 'required' => true));
     $e->setAttrib('onchange', 'admin.currentManObj.refresh()');
     $form->addElement($e);
     $e = new Zend_Dojo_Form_Element_DateTextBox('toDate', array('label' => 'To', 'required' => true));
     $e->setAttrib('onchange', 'admin.currentManObj.refresh()');
     $form->addElement($e);
     //		$e = new Zend_Dojo_Form_Element_Button( 'refresh', array ('label' => 'Refresh' ) );
     //		$e->setAttrib('onchange', 'admin.currentManObj.refresh()');
     //		$form->addElement($e);
     Zend_Dojo::enableForm($form);
     $form->setDefaults(array('toDate' => $zdate->getIso(), 'fromDate' => $zdate->getIso()));
     return $form;
 }
开发者ID:TDMU,项目名称:contingent5_statserver,代码行数:19,代码来源:Changes.php

示例5: evaluateAction

 public function evaluateAction()
 {
     $username = $this->_getParam('username');
     if (!empty($username)) {
         $form = $this->_getEvaluationForm($username);
         if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
             $values = $form->getValues();
             require_once APPLICATION_PATH . "/model/Evaluation.php";
             $table = new Evaluation();
             $date = new Zend_Date();
             $data['date'] = $date->getIso();
             $data['rating'] = $values['rating'];
             $data['motivation'] = $values['motivation'];
             $data['evaluator'] = Zend_Auth::getInstance()->getIdentity()->username;
             $data['evaluated_user'] = $username;
             $table->insert($data);
             $this->_helper->redirector('profile', 'user', 'default', array('username' => $username, 'evaluationInserted' => true));
         }
         $this->view->form = $form;
     }
 }
开发者ID:Kjir,项目名称:carpond,代码行数:21,代码来源:UserController.php

示例6: format_iso

 public static function format_iso($strDate)
 {
     $date = new Zend_Date($strDate, 'dd/MM/yyyy');
     return $date->getIso();
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:5,代码来源:Date.php

示例7: testSetFirstDayOfLeapYear

 /**
  * @ZF-7745
  *
  */
 public function testSetFirstDayOfLeapYear()
 {
     $date = new Zend_Date(2008, Zend_Date::YEAR);
     $date->setDayOfYear(1);
     $this->assertEquals('2008-01-01T00:00:00+05:00', $date->getIso());
     $date->setDayOfYear(61);
     $this->assertEquals('2008-03-01T00:00:00+05:00', $date->getIso());
     $date->setDayOfYear(62);
     $this->assertEquals('2008-03-02T00:00:00+05:00', $date->getIso());
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:14,代码来源:DateTest.php

示例8: testToEbayValue

 public function testToEbayValue()
 {
     $this->assertSame('1', Zend_Service_Ebay_AbstractConcrete::toEbayValue(true));
     $this->assertSame('0', Zend_Service_Ebay_AbstractConcrete::toEbayValue(false));
     require_once 'Zend/Date.php';
     $date = new Zend_Date();
     $this->assertSame($date->getIso(), Zend_Service_Ebay_AbstractConcrete::toEbayValue($date));
     $date = new DateTime();
     $this->assertSame($date->format(DateTime::ISO8601), Zend_Service_Ebay_AbstractConcrete::toEbayValue($date));
     $this->assertSame('10', Zend_Service_Ebay_AbstractConcrete::toEbayValue(10));
 }
开发者ID:omusico,项目名称:logica,代码行数:11,代码来源:AbstractTest.php

示例9: testGetIso

 /**
  * Test for getIso
  */
 public function testGetIso()
 {
     $locale = new Zend_Locale('de_AT');
     $date = new Zend_Date(1010101010, null, $locale);
     $d2 = new Zend_Date(1010101010, null, $locale);
     $result = $date->getIso();
     $this->assertTrue(is_string($result));
     $this->assertSame($result, '2002-01-04T04:36:50+05:00');
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:DateTest.php

示例10: testTimezoneArray

 public function testTimezoneArray()
 {
     date_default_timezone_set('UTC');
     $date = new Zend_Date(array('year' => 2007, 'month' => 1, 'day' => 1, 'hour' => 20, 'minute' => 45, 'second' => 37, 'en_US'));
     $this->assertSame('2007-01-01T20:45:37+00:00', $date->getIso());
     date_default_timezone_set('CET');
     $date = new Zend_Date(array('year' => 2007, 'month' => 1, 'day' => 1, 'hour' => 1, 'minute' => 45, 'second' => 37, 'en_US'));
     $this->assertSame('2007-01-01T01:45:37+01:00', $date->getIso());
     $date = new Zend_Date(array('year' => 2006, 'month' => 4, 'day' => 18, 'hour' => 12, 'minute' => 3, 'second' => 10, 'de_AT'));
     $this->assertSame('2006-04-18T12:03:10+02:00', $date->getIso());
 }
开发者ID:lortnus,项目名称:zf1,代码行数:11,代码来源:DateTest.php

示例11: dateToIso

 /**
  * Takes a Magento date string or Zend_Date and turns it into an
  * ISO 8601 compliant formatted string of the date.
  *
  * @param string|integer|Zend_Date $date Magento date string, Unix timestamp, or Zend_Date object
  * @return string ISO date (using Z instead of +00:00)
  */
 public function dateToIso($date)
 {
     if (is_string($date)) {
         $date = new Zend_Date($date);
     }
     if (is_int($date)) {
         $date = new Zend_Date($date, Zend_Date::TIMESTAMP);
     }
     return str_replace('+00:00', 'Z', $date->getIso());
 }
开发者ID:VadzimBelski-ScienceSoft,项目名称:magento-MagSolr,代码行数:17,代码来源:Data.php

示例12: testFromArray

 public function testFromArray()
 {
     $date = new Zend_Date(array('day' => 04, 'month' => 12, 'year' => 2006, 'hour' => 10, 'minute' => 56, 'second' => 30), 'en_US');
     $this->assertSame($date->getIso(), '2006-12-04T10:56:30+05:00');
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:5,代码来源:DateTest.php

示例13: confirmAction

 public function confirmAction()
 {
     $ride = $this->_getParam("ride");
     $user = $this->_getParam("username");
     if (!empty($ride) && !empty($user)) {
         require_once APPLICATION_PATH . "/model/UserRide.php";
         $table = new UserRide();
         $table->update(array('confirmation' => true), array($table->getAdapter()->quoteInto("ride = ?", $ride), $table->getAdapter()->quoteInto("user = ?", $user)));
         $date = new Zend_Date();
         $owner = Zend_Auth::getInstance()->getIdentity()->username;
         $mess['sender'] = $owner;
         $mess['receiver'] = $user;
         $mess['date'] = $date->getIso();
         $mess['subject'] = "Conferma partecipazione a viaggio";
         $mess['text'] = "{$owner} ha accettato la tua partecipazione al suo viaggio. Contattalo per accordarvi sui dettagli!";
         require_once APPLICATION_PATH . "/model/Message.php";
         $table = new Message();
         $table->insert($mess);
     }
 }
开发者ID:Kjir,项目名称:carpond,代码行数:20,代码来源:RideController.php

示例14: isQuestionnaireExecution

 public function isQuestionnaireExecution($QstnId)
 {
     $date = new Zend_Date();
     $now = $date->getIso();
     $where = array('Id = ?' => $QstnId, 'OperationBeginning <= ?' => $now, 'OperationEnding >= ?' => $now);
     return DbTable_Questionnaire::getInstance()->fetchRow($where, 'OperationBeginning');
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:7,代码来源:Questionnaire.php

示例15: getDateTimeIso

 /**
  * method to retreive date in ISO-8601 format
  * if date is not set retreive the current date
  * 
  * @param Zend_Date Zend date object
  * 
  * @return string Date in ISO-8601 format
  */
 public static function getDateTimeIso($date = null)
 {
     $date = new Zend_Date($date, null, Application_Model_General::getLocale(null, true));
     return $date->getIso();
 }
开发者ID:carriercomm,项目名称:NPG,代码行数:13,代码来源:General.php


注:本文中的Zend_Date::getIso方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。