Join Bill Weinman for an in-depth discussion in this video Specifying a specific time zone with AT TIME ZONE, part of PostgreSQL 9 with PHP Essential Training.
Postgres supports the SQL standard AT TIME ZONE construct for converting time…zones to other time zones.…For the purposes of this example I've created this table which has two columns,…a and b. Column a has the With Time Zone attribute and column b does not.…So it's being stored without the Time Zone.…And I'm inserting one row with DEFAULT, DEFAULT, just so they both get…the current timestamp.…So when I run this, you'll see the current timestamp comes up in exactly the…same timed down to the microsecond as you can see there, except column a has the…Time Zone attribute, so it says, -07, which is the current time zone where I'm on the West…Coast of the United States.…
It's in the summer, so this is Pacific Daylight Time, which is seven hours…before Greenwich Mean Time.…So let's go ahead and experiment with the AT TIME ZONE clause.…So I'm going to say here SELECT a AT TIME ZONE 'EDT', which is Eastern Daylight…Time.I'm going to say, AS a, because otherwise Postgres doesn't know how to name…the column and it ends up folding the two columns together.…
- 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
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?
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.