Solved

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

Posted on 2014-04-14
2
269 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
2 Comments
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses how to create an extensible mechanism for linked drop downs.
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now