TAILIEUCHUNG - Professional Information Technology-Programming Book part 72

Tham khảo tài liệu 'professional information technology-programming book part 72', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Summary In this lesson you have learned the basics of regular expressions. If you want to find out more you can refer to Sams Teach Yourself Regular Expressions in 10 Minutes by Ben Forta. In the next lesson you will learn how to handle date and time values in PHP. Lesson 9. Working with Dates and Times In this lesson you will learn how to store display and manipulate date and time values in PHP. Date Formats PHP does not have a native date data type so in order to store date values in a script you must first decide on the best way to store these values. Do-It-Yourself Date Formats Although you often see dates written in a structured format such as 05 03 1974 or 2001-12-31 these are not ideal formats for working with date values. However the latter of these two is more suitable than the first because the order of its components is from most significant the year to the least significant the day so values can be compared using the usual PHP operators. As a string 2002-01-01 is greater than 2001-12-31 but because comparisons are performed more efficiently on numbers than on strings this could be written better as just 20020201 where the format is YYYYMMDD. This format can be extended to include a time portionagain with the most significant elements firstas YYYYMMDDHHMMSS for example. However date arithmetic with this format is nearly impossible. While you can add one to 2 004 0501 for instance and find the next day in that month simply adding one to 20030531 would result in a nonsense date of May 32. Unix Timestamp Format The Unix timestamp format is an integer representation of a date and time. It is a value that counts the number of seconds since midnight on January 1 1970. The Unix Epoch A timestamp with integer value zero represents precisely midnight Greenwich Mean Time GMT on January 1 1970. This date is known as the Unix Epoch. Right now we have a 10-digit date and time timestamp. To find the current timestamp you use the time function echo time The Unix .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.