Join Bill Weinman for an in-depth discussion in this video Getting parts of a timestamp with EXTRACT, part of PostgreSQL 9 with PHP Essential Training.
Postgres supports the EXTRACT function for extracting parts of dates and times.…For example, we can say SELECT EXTRACT(HOUR FROM TIMESTAMP and give it a timestamp, say.…And when I press Go, it says date part, but it's the hour.…It says 15, which is the hour, which is exactly what we asked for.…If instead I were to say MINUTE, we get one for the MINUTE part or if I were…to just say MONTH, we get 10 for the Month part.…
So this is very convenient.…In fact, we can even do this with intervals.…I can say EXTRACT( MONTH FROM INTERVAL, and then give it an interval, 3 years 2…months, 1 hour, 15 minutes and 2 is the month.…So it extracted the months from the interval.…So this is a useful tool for helping you to do math on different parts of your…dates and times and intervals.…
- Installing PostgreSQL
- Understanding database architecture
- Inserting, updating, and deleting data in a table
- Creating a database library
- Indexing ID fields
- Storing numbers, text, and Boolean values
- Reading data
- Using casts to force type
- Using mathematical functions
- Concatenating strings
- Working with date and time functions and operators
- Defining CRUD
- Using PHP to insert, read, update, and delete rows in a database
Skill Level Beginner
PHP with MySQL Beyond the Basicswith Kevin Skoglund10h 26m Intermediate
1. Quick Start
2. Creating a Database
3. Data Types
4. Storing and Reading Data
5. SQL Expressions
6. Mathematical Functions and Operators
Using math functions3m 2s
7. String Functions and Operators
8. Date and Time Functions and Operators
9. PHP Interfaces
10. Web Applications
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.