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


PHP Utilities::isoDate方法代码示例

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


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

示例1: serialize

 /**
  * Serializes the current state.
  * 
  * @param CurrentState  $state        The current state.
  * @param IOutputStream $outputStream The output stream.
  * 
  * @return none
  */
 public function serialize($state, $outputStream)
 {
     $statusLeaseInfo = array('StatusLease' => array('@attributes' => array('ClientId' => $state->getClientId())));
     if ($state instanceof AcquireCurrentState) {
         $statusLeaseInfo['StatusLease']['Acquire'] = array('Incarnation' => $state->getIncarnation(), 'Status' => $state->getStatus(), 'Expiration' => Utilities::isoDate(date_timestamp_get($state->getExpiration())));
     } elseif ($state instanceof ReleaseCurrentState) {
         $statusLeaseInfo['StatusLease']['Release'] = array();
     }
     $currentState = Utilities::serialize($statusLeaseInfo, 'CurrentState');
     fwrite($outputStream, $currentState);
 }
开发者ID:southworkscom,项目名称:azure-sdk-for-php,代码行数:19,代码来源:XmlCurrentStateSerializer.php

示例2: testGetEntity

 /**
  * @covers WindowsAzure\Table\Internal\AtomReaderWriter::getEntity
  * @covers WindowsAzure\Table\Internal\AtomReaderWriter::__construct
  * @covers WindowsAzure\Table\Internal\AtomReaderWriter::_serializeAtom
  * @covers WindowsAzure\Table\Internal\AtomReaderWriter::_generateProperties
  */
 public function testGetEntity()
 {
     // Setup
     $atomSerializer = new AtomReaderWriter();
     $entity = TestResources::getTestEntity('123', '456');
     $expected = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n" . '<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">' . "\n" . ' <title/>' . "\n" . ' <updated>' . Utilities::isoDate() . '</updated>' . "\n" . ' <author>' . "\n" . '  <name/>' . "\n" . ' </author>' . "\n" . ' <id/>' . "\n" . ' <content type="application/xml">' . "\n" . '  <m:properties>' . "\n" . '   <d:PartitionKey>123</d:PartitionKey>' . "\n" . '   <d:RowKey>456</d:RowKey>' . "\n" . '   <d:CustomerId m:type="Edm.Int32">890</d:CustomerId>' . "\n" . '   <d:CustomerName>John</d:CustomerName>' . "\n" . '   <d:IsNew m:type="Edm.Boolean">1</d:IsNew>' . "\n" . '   <d:JoinDate m:type="Edm.DateTime">2012-01-26T18:26:19Z</d:JoinDate>' . "\n" . '  </m:properties>' . "\n" . ' </content>' . "\n" . '</entry>' . "\n";
     // Test
     $actual = $atomSerializer->getEntity($entity);
     // Assert
     $this->assertEquals($expected, $actual);
     return $actual;
 }
开发者ID:rdohms,项目名称:azure-sdk-for-php,代码行数:18,代码来源:AtomReaderWriterTest.php

示例3: testIsoDate

 /**
  * @covers WindowsAzure\Common\Internal\Utilities::isoDate
  */
 public function testIsoDate()
 {
     // Test
     $date = Utilities::isoDate();
     // Assert
     $this->assertNotNull($date);
 }
开发者ID:southworkscom,项目名称:azure-sdk-for-php,代码行数:10,代码来源:UtilitiesTest.php

示例4: testSetTimestamp

 /**
  * @covers WindowsAzure\Table\Models\Entity::setTimestamp
  * @covers WindowsAzure\Table\Models\Entity::getTimestamp
  */
 public function testSetTimestamp()
 {
     // Setup
     $entity = new Entity();
     $expected = Utilities::convertToDateTime(Utilities::isoDate());
     // Test
     $entity->setTimestamp($expected);
     // Assert
     $this->assertEquals($expected, $entity->getTimestamp());
 }
开发者ID:jdruid,项目名称:Microsoft-Azure-PHP-SDK-Storage,代码行数:14,代码来源:EntityTest.php

示例5: _serializeAtom

 /**
  * Serializes the atom into XML representation.
  * 
  * @param array $properties The atom properties.
  * 
  * @return string
  */
 private function _serializeAtom($properties)
 {
     $xmlw = new \XmlWriter();
     $xmlw->openMemory();
     $xmlw->setIndent(true);
     $xmlw->startDocument(strtoupper($this->_xmlVersion), $this->_xmlEncoding, 'yes');
     $xmlw->startElementNS(null, 'entry', $this->_atomNamespaceName);
     $xmlw->writeAttribute("xmlns:{$this->_dataServicesPrefix}", $this->_dataServicesNamespaceName);
     $xmlw->writeAttribute("xmlns:{$this->_dataServicesMetadataPrefix}", $this->_dataServicesMetadataNamespaceName);
     $xmlw->writeElement('title');
     $xmlw->writeElement('updated', Utilities::isoDate());
     $xmlw->startElement('author');
     $xmlw->writeElement('name');
     $xmlw->endElement();
     $xmlw->writeElement('id');
     $xmlw->startElement('content');
     $xmlw->writeAttribute('type', Resources::XML_CONTENT_TYPE);
     $xmlw->startElementNS($this->_dataServicesMetadataPrefix, 'properties', null);
     $this->_generateProperties($xmlw, $properties);
     $xmlw->endElement();
     $xmlw->endElement();
     $xmlw->endElement();
     return $xmlw->outputMemory(true);
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:31,代码来源:AtomReaderWriter.php


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