To convert value from one type to another use explicit type conversion function
1) to_timestamp -- used to convert bigint to timestamp with or with out timezone.
2) epoch -- used to convert timestamp to bigint value.
here see the example
1) to_timestamp
SELECT to_timestamp(1283437580); -- it returns the output like
to_timestamp
timestamp with time zone
----------------------
"2010-09-02 19:56:20+05:30"
want to display the timestamp with out timezone
SELECT to_timestamp(1283437580)::timestamp;
to_timestamp
timestamp with time zone
----------------------
"2010-09-02 19:56:20"
2) epoch
SELECT EXTRACT(epoch FROM current_timestamp(0)) -- it return output like
date_part
double precision
-------------------
1283753630
-- more explicit type conversion will update here...
All about data processing & analytics. Open source database,No-SQL and Hadoop. Discussed issues/solution which I've got during my experience..
Sunday, September 5, 2010
Subscribe to:
Post Comments (Atom)
Labels
- #agriculture (1)
- #ai (5)
- #pdf (1)
- Big Data (30)
- blogging (3)
- data analytics (5)
- data science (7)
- Deep Learning (4)
- Hadoop (28)
- Hadoop Eco System (27)
- hdfsCommands (4)
- Hive (5)
- IssueSolution (4)
- jobs (3)
- links (1)
- Machine Learning (4)
- mahout (2)
- MapReduce (1)
- MongoDB (6)
- MySQL (4)
- PlpgSQL (8)
- postgres (6)
- PostgreSQL (53)
- R (20)
- RHadoop (2)
- search keywords (1)
- social (2)
- spark (3)
- twitter (6)
- usecase (2)
- visualization (7)
- weka (1)
1 comment:
Hi nice reeading your post
Post a Comment