Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting 'fractional' seconds in date time for some reason... need to lose the extra 2 digits

Posted on 2014-04-14
2
Medium Priority
?
278 Views
Last Modified: 2014-04-14
Using codeigniter (though I suppose doesn't really matter).
I pass a user_id to my model to get the correct time for their timezone prior to inserting into my db. When I echo out what is being created, I get the extra 2 digits for some inexplicable reason:

2014-04-14 10:40:3024
//passing the user id
	public function get_time($user_id)
	{
		return $this->db
			->select('timezone')
			->from('user')
			->where('id', $user_id)
			->get()->row();
	}

Open in new window

Any idea what is going on and how I could correct this?
0
Comment
Question by:tjyoung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 39999143
Maybe coincidence but the last 2 digits are 24 - does this indicate the time format (12 or 24 hour)

Also, you have a couple of parts here that aren't really explained

Firstly, how is the date stored in your database (does it include the 24 part...is it stored in a date column).

Secondly, how are you echoing out the returned value - maybe it's just a formatting issue?
0
 
LVL 1

Author Closing Comment

by:tjyoung
ID: 39999238
Hi, your pointing out the 24 is what made my error click. I was echoing out the time and there wasn't an issue but... I was also returning the last inserted ID which happened to be 24. So it was being appended. Duh... kill me.
Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question