Jump to content

Archived

This topic is now archived and is closed to further replies.

cyprus

Date Format syntax *solved*

Recommended Posts

I am tring to make my dates look easier to read in a list. I have tried the following, as well as numerous permutaions!! Thanks

case 'UnitPrice':$val = '£' . number_format($val,2); break;
case 'Qty':    $val = number_format($val, 0) . ' off'; break;
case 'RunningTotal':      $val = '£' . number_format($val,2);break;
[b]case 'Orderdate':      $val = .date_format(date("j-M-Y", strtotime(['Orderdate']))); break;[/b]

Share this post


Link to post
Share on other sites
date_format() ??? Still got your VB hat on.

Try
[code]
case 'Orderdate':  $val = date("j-M-Y", strtotime($val)); break;
[/code]

Share this post


Link to post
Share on other sites
Thanks again Barand. VB Hat?, so it still shows does it? I wish it was in VB. What you did worked as ever, thanks again. While there, do you know of any packages that enable HTML to be written around PHP. Sorry to admit I normally cheat and use Frontpage to do all the HTML side, ie making pages look smart, and then go into writing the PHP bits so that I can place things in tables. If I work backwards, then I get in a mess and my page gets created in a tabular form, wasted page areas. Thought I would just ask, thanks again.

Share this post


Link to post
Share on other sites
I tend to to echo the HTML code from within PHP and avoid wysiwyg editors - I like to be in control.

(I use [url=http://www.nusphere.com]Nusphere PHPEd[/url] - editor, instant manual lookup, code insight, debugger, profiler, edit via ftp, remote debugging, db client interface etc etc.

For tables of data I use my baaGrid class (see my sig, bit like .net datagrid)

include 'baagrid.php';
$grid = new baaGrid("SELECT bla FROM tablename");
    // optional formatting options go here
$grid->display();

Done - instant table, but lots of formatting options too. (End of plug).

I was wondering why you opted for the SELECT to display the returned data rather a conventions table, which would give a far more flexible method of displaying the results?

Share this post


Link to post
Share on other sites
Thanks. That Baagrid is something else!! I miss all my VB goodies like Flexgrid etc. Feel almost homesick now. Certanly very useful, probably a bit expensive for light useage. Had I gone the other way, ie insert checkboxes first instead of programatically growing them, I'd know where they were going to appear. Aynhow all good fun if you can survive it. Regards

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.