Session 3BBK P1 Module05-May-2007 : [‹#›] Date Manipulation.

Slides:



Advertisements
Similar presentations
PHP: Date() Function The PHP date() function formats a timestamp to a more readable date and time.
Advertisements

LIS651 lecture 2 mySQL and PHP mySQL functions Thomas Krichel
LIS651 lecture 1 arrays functions & sessions Thomas Krichel
Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD.
Integrated Business Applications with Databases (D3) Jenny Pedler
Session 3BBK P1 ModuleApril 2010 : [#] Regular Expressions.
What Time Is It? Martin Phillips Ladybridge Systems.
Introduction to SQL Tuning Brown Bag Three essential concepts.
 Introduction  The Windows 7 login script I inherited  Tools  Flow Chart  Requirements  Auto Login  Auto Shutdown  Unix Timestamps  Design 
How To Create An Absence
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: Moving On..
CS 116 Tutorial 6 Strings, Raw Input, Lists. 1. Write a function convert_format that consumes nothing, but takes keyboard input. The program prompts "Enter.
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
CG0119 Web Database Systems Parsing XML using SimpleXML.
Database Chapters.
BBK P1 Module2010/11 : [‹#›] Regular Expressions.
Algebraic Transformations Page 1 © 2013 Hortonworks HIVE-784: Sub Query in Where or Having clause HIVE-5555: Alt. Join Syntax; Join conditions in the Where.
Copyright © 2007, Oracle. All rights reserved Using Single-Row Functions to Customize Output Modified: October 21, 2014.
Dr. Kalpakis CMSC 661, Principles of Database Systems Representing Data Elements [12]
ITC 240: Web Application Programming SUBHASH PRAJAPATI 04/09/15.
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
Kirkwood Center for Continuing Education By Fred McClurg, Introduction to PHP and MySQL Copyright © 2010 All Rights Reserved.
Navigation and Ancillary Information Facility NIF Time Conversion and Formats June 2004.
Storing data Getting data out Data types Ruby as a foundation Program Variables Click icon to hear comments (the download may take a minute)
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Basis Data Terapan Yoannita. SQL Server Data Types Character strings: Data typeDescriptionStorage char(n)Fixed-length character string. Maximum 8,000.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Includes and Dates.
Formatting and Parsing. Slide 2 Introduction Two core topics Parsing - Converting strings to other types (numbers, dates, …) Formatting Converting those.
Single Row Functions Week 2. Objectives –Describe types of single row functions in SQL –Describe and use character, number, date, general and conversion.
EXPRESSION Transformation. Introduction ►Transformations help to transform the source data according to the requirements of target system and it ensures.
Single Row Functions. Objectives –Use character, number, and date functions –Use conversion functions –Describe types of single row functions in SQL.
A Level Computing#BristolMet Session ObjectivesU2#S12 MUST describe the terms modal and pretty printing in term of input and output facilities. SHOULD.
Using Dates in Excel Stored as a “serial number” which represents the number of days that have taken place since the beginning of the year 1900 – 1/1/1900=1.
44220: Database Design & Implementation Implementing Physical Domains Ian Perry Room: C41C Tel Ext.: 7287
Slide 1 PHP Predefined Functions ITWA113. Murach’s ASP.NET 3.5/C#, C1© 2008, Mike Murach & Associates, Inc. Slide 2 PHP Predefined Functions Objectives.

Exercise 6 Introduction to C# CIS Create a class called ParseDates that will parse a formatted string containing a date into separate integers.
Working with Date and Time ISYS 475. How PHP processes date and time? Traditional way: – Timestamp Newer and object oriented way: – DateTime class.
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
IMS 3253: Dates and Times 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Date and Time Data Turning Strings into.
The reading is 7.38 mm. The reading is 7.72 mm.
PRÁCE S ČASEM V PHP. DATE  string date ( string $format [, int $timest amp = time() ] )  echo date('l jS \of F Y h:i:s A');  Monday 8th of August 2005.
Java String and Date ISYS 350.
SQL – Dates and Times.
Servlet Date Operations
Java Date ISYS 350.
Web Systems Development (CSC-215)
Web Server Design Week 4 Old Dominion University
PLM-Europe Presentation Template :9 Format Usage: Please copy
SQL OVERVIEW DEFINING A SCHEMA
Final Exam.
What Time Is It? Martin Phillips Ladybridge Systems.
Date Functions Farrokh Alemi, Ph.D.
Java Date ISYS 350.
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Chapter 4 Introduction to MySQL.
MySQL Database System Installation Overview SQL summary
Kirkwood Center for Continuing Education
Advanced Concepts and AJAX
Java Date ISYS 350.
Applications of Regular Closure
Thing / Person:____________________ Dates:_________________
Trainer: Bach Ngoc Toan– TEDU Website:
Database Instructor: Bei Kang.
WP3 Workshop 16/01/2002 Timestamps.
Java Date ISYS 350.
2019 PLM-Europe Presentation Template :9 Format
Temporal Data Part V.
Working with dates and times
Presentation transcript:

Session 3BBK P1 Module05-May-2007 : [‹#›] Date Manipulation

Session 3BBK P1 Module05-May-2007 : [‹#›] Unix Epoch..? The easiest way to handle dates in PHP is using UNIX timestamps. A UNIX timestamp is the number of seconds since the UNIX Epoch. The Epoch is 1 st Jan :00 GMT.

Session 3BBK P1 Module05-May-2007 : [‹#›] Get current time Use the time() function to get current or relative time. <?php $now = time(); $nextWeek = time() + (7 * 24 * 60 * 60); // 7 days; 24 hours; 60 mins; 60secs ?>

Session 3BBK P1 Module05-May-2007 : [‹#›] Display a time.. To display a time use the date() function along with a format string. <?php $nextWeek = time() + (7*24*60*60); echo ‘Next week: ‘; echo date(‘d-m-Y’,$now).’ ’; ?> Format strings:

Session 3BBK P1 Module05-May-2007 : [‹#›] String to timestamp To convert a string to date, use strtotime() <?php echo strtotime("now"); echo strtotime("10 September 2000"); echo strtotime("+1 day"); echo strtotime("+1 week"); echo strtotime("next Thursday"); echo strtotime("last Monday"); ?>

Session 3BBK P1 Module05-May-2007 : [‹#›] String to timestamp Note that strtotime() assume a US date format on string such as mm/dd/yyyy, so some modifications may be required.

Session 3BBK P1 Module05-May-2007 : [‹#›] What about dates before 1970? Negative timestamps are not consistently supported in PHP. Therefore we cannot use timestamps when using dates that might be before 1970.

Session 3BBK P1 Module05-May-2007 : [‹#›] The full information.. We have looked at a sub-selection of this information. If you want to do something with dates.. This is the place to start looking.

Session 3BBK P1 Module05-May-2007 : [‹#›] HOE 7 : Handling Dates

Session 3BBK P1 Module05-May-2007 : [‹#›] Review Know what an integer UNIX date is. Can manipulate dates in PHP: creating, displaying, parsing from string data.