Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ddmmyyyy read from table but convert in page to show friendly

Posted on 2005-04-25
6
Medium Priority
?
319 Views
Last Modified: 2010-04-17
Hi,

I am storing dates in a table in the format ddmmyyyy (I need this without seperators such as - or / which I know would make easier to convert). I think I need to have a custom strtotime or similar function but can't work it out.

Cheers.
0
Comment
Question by:phreak7t7
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 13860741
Try something like

MyDate = Date(right(strDate,4),mid(strDate,3,2), Left(strDate,2))

mlmcc
0
 

Author Comment

by:phreak7t7
ID: 13860967
Sorry.. I don't recognise this.. is it php?
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 13861002
which programming language?
For PHP could be something like this:
$t = mktime(0,0,0,substr($date,2,2),substr($date,0,2),substr($date,4,4));
echo date("d F, Y", $t);
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 22

Expert Comment

by:JesterToo
ID: 13861099
What programming language are you using?  The line that mlmcc posted appears "VB like" but the syntax isn't quite right for VB.

     MyDate = cdate(right(strDate,4) & "/" & mid(strDate,3,2) & "/" & left(strDate,2))

is one way to do it in VB.
0
 

Author Comment

by:phreak7t7
ID: 13861200
sorry.. php please
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 13861239
Already posted PHP, is this what you need?
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes

578 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