bhamm Posted November 21, 2008 Posted November 21, 2008 forgive me if this has been answered elsewhere on the forum, but i didn't see anything mentioned.. i'm pulling a 'meeting time' field like so: echo $meeting->getField('meeting time') and the filemaker api is showing me "hh:mm:ss", regardless of how the time is stored in the database. Meaning, i can type in "3:00 PM" into filemaker.. there's no formatting on it in the database. But online, all i can get out of it is "15:00:00". now, i could make them text fields - we're not calculating anything against them (at this point), but i'd prefer to leave them as 'time' if there's an easy way to adjust how they appear online. I could also make a extra 'calc' field for each time in question, and use /that/ on the web.. but that seems very, um.. non-elegant. : .. suggestions? thank you!
Baloo Posted November 21, 2008 Posted November 21, 2008 PHP is not a strongly typed language. Echo will treat everything as a string unless told to do otherwise. echo date("g:i A", strtotime($meeting->getField('meeting time') )); //outputs 3:00 PM when `meeting time` contains 15:00 see http://us.php.net/manual/en/function.date.php and http://us.php.net/manual/en/function.strtotime.php for further details
bhamm Posted November 21, 2008 Author Posted November 21, 2008 thank you, i thought it'd be something straightforward like that.. i didn't realize i would use the "date" function to parse a "time" though. appreciate it :
Recommended Posts
This topic is 6106 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now