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

  • SEARCH
  • Home
  • 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 6704157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:15:22+00:00 2026-05-26T07:15:22+00:00

here is the code first $sql = ‘SELECT DATETIME, CURRVALUE FROM DATEVALUE’; $stid =

  • 0

here is the code first

$sql = 'SELECT DATETIME, CURRVALUE FROM DATEVALUE';
$stid = oci_parse($conn, $sql);
oci_define_by_name($stid,'DATETIME', $agev);
oci_define_by_name($stid,  'CURRVALUE', $snv);
oci_execute($stid);
$resultXML = new SimpleXMLElement(stripslashes('<data></data>'));
while (oci_fetch($stid)) {  
      $agev = oci_result($stid, 'DATETIME');
    $snv = oci_result($stid, 'CURRVALUE');
     //settype($agev, "string"); 
    $date_2 = strtotime($agev);
    settype($date_2, "integer"); 
     //settype($snv, "float");  
    $temp = $resultXML->addChild('node'); 
    $temp->addChild('agev',$date_2);
    $temp->addChild('snv',$snv); 
} 

<node>
<agev>0</agev>
<snv>1</snv>
</node>

result for currvalue is good but for datetime value it output zero only,
if i do addtimevalue without using strtotime it will output datetime in string but its not what i need….
please helppppp ~.~

  • 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-05-26T07:15:23+00:00Added an answer on May 26, 2026 at 7:15 am

    Here are two ways that could help fix the problem.

    First (possibly better) way: Change your SQL query.

    Have Oracle output the date using a different format, one that strtotime will recognize. If DATETIME is a normal date-type column in your database, consider using the TO_CHAR Oracle function to change its output format. Something like:

    $sql = "SELECT TO_CHAR(DATETIME, 'YYYY-MM-DD HH24:MI:SS') AS DATETIME, CURRVALUE FROM DATEVALUE";
    

    Second way: use strptime.

    Instead of using strtotime, consider using strptime. The date format you show in your comments appears to be close to:

    %d-%b-%y %H.%I.%S %p
    

    I’m not sure if there’s a date format option for the milliseconds part. Assuming it will parse it correctly without that, changing the line:

    $date_2 = strtotime($agev);
    

    to:

    $date_2 = strptime($agev, '%d-%b-%y %H.%I.%S %p');
    

    should do it. You’ll still get an error, though, if my assumption is wrong.

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

Sidebar

Related Questions

first post here, and probably an easy one. I've got the code from Processing's
I have a question here.I better paste my code first SET @Sql = 'DECLARE
here's the main code at first I thought is was the message box but
Let me first put the code snippets here. I am just using the ASP.NET
First off here is the code! <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
Here is the code: string str; cin>>str; cout<<first input:<<str<<endl; getline(cin, str); cout<<line input:<<str<<endl; The
So, here's my question: Why won't the code in the first snippet work when
Here is the first part of my controller code: public class ControlMController : Controller
First, here is the C# code and the disassembled IL: public class Program<T> {
First, to make my job explaining a bit easier, here's some of my code:

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.