タグ

dateとphpに関するlamichのブックマーク (5)

  • How to calculate the difference between two dates using PHP?

  • PHP: filemtime - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    PHP: filemtime - Manual
  • 日付と時間/PHP入門

    ◆ 日付と時間 PHPでは、日付や時間に関する組み込み関数が多数定義されています。ここでは、一般的によく利用されている関数を中心にして、日付と時間の扱いについて解説します。 ■ PHPで扱える暦 PHPで日付を扱うとき、その基となる日数の算出に必要な「暦」が幾つか存在しています。どれを基の暦にするのかは、作者の感性に依ります。 ■ 世界協定時 UTC 世界中の時刻を合わせるための公式な時刻を定めているのが世界協定時です。グリニッジ標準時は、天文学を主体として時間を定めていますが、世界標準時は、セシウム原子の振動を基準にして定められている物理学的な時刻です。 JavaScriptでも利用されていますが、PHPでも世界協定時を利用することは可能です。また、世界協定時を使うための関数として、time()、date()、getdate() が定義されており、世界各地のローカルタイムを参照できる

  • PHPにおける負のunix timeの扱いとPropel

    こんにちは、hnwです。さて、今回はPHPの時刻とPropelに関する話題です。 PropelはPHPで使われるO/Rマッパーとしてはメジャーなものの一つです。symfonyでは標準のO/Rマッパーとして採用されていますし、Mojaviなど他のフレームワークを利用した際もO/RマッパーとしてPropelを採用している事例があります。 ところで、PropelではRDBのtimestamp型のカラムを扱う際に内部的にunix timeに直すような実装をしています。SQL標準ではtimestamp型は西暦1年から9999年まで表せるわけですから、unix timeに直す実装というのはtimestamp型の全ての値を正しく扱えないような、いわば乱暴な実装であるといえます。 完璧ではないにせよ、実際に利用する際の適用の可否を考えてみます。unix timeは1970年1月1日からの経過秒ですから、誕

  • PHP: date - Manual

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    PHP: date - Manual
  • 1