Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:24:26+00:00 2026-06-12T16:24:26+00:00

I often read data from Oracle into R . To get around the TIMESTAMP

  • 0

I often read data from Oracle into R. To get around the TIMESTAMP format in some of my tables, I read in the column in as a character string with TO_CHAR in my SQL statement.

However, I want to convert the data held in the string back into a date + time format that R can utilize. Unfortunately,I have no idea as to how to best do this, especially considering the AM/PM component. Stripping out the date is easy enough, but I have no idea as to how to retain the time part of each record.

Here are a few records of data:

c("31-JUL-12 10.08.35.432 AM", "31-JUL-12 08.53.18.316 AM", "18-JUL-12 01.17.52.939 PM", 
"13-AUG-12 05.34.11.405 PM", "15-AUG-12 02.04.31.505 PM", "21-AUG-12 09.10.03.976 AM"
)

One note: these data are timezone EST.

Any help will be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:24:28+00:00Added an answer on June 12, 2026 at 4:24 pm

    If you deal with dates/times much, you should familiarize yourself with ?strptime

    > strptime(oracle, format='%d-%b-%y %I.%M.%OS %p', tz='America/New_York')
    [1] "2012-07-31 10:08:35.432 EDT" "2012-07-31 08:53:18.316 EDT" "2012-07-18 13:17:52.939 EDT" "2012-08-13 17:34:11.405 EDT" "2012-08-15 14:04:31.505 EDT" "2012-08-21 09:10:03.976 EDT"
    

    Note that I assumed that by “EST” you really meant Eastern time in New York, NY. From help(timezone):

    Beware that some of these designations may not be what you think: in particular EST is a time zone used in Canada without daylight savings time, and not EST5EDT nor (Australian) Eastern Standard Time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when i read through source files of opensource projects i often come across some
When I read source from open source projects I often find a comment line
Often times I write some SQL like this: string sql = @ -- Multi-line
The db tables that I am using are changing very often meaning new column
I'm trying to read serial data from my Arduino using Java. I have followed
I am exporting data from a database using PHP to convert it into a
When I use the read.csv() function in R to load data, I often find
I often use Octave to create data that I can plot from my lab
I often read articles saying something along the lines of chmod 777 is bad!
I've often read that in the Sun JVM short-lived objects (relatively new objects) can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.