Formatting date
Apologies for the vagueness of the query and I promise I've had a search (and will have another look in a minute!!) but i'm struggling with the following issue:
I've created a mysql database using phpmyadmin with primary key, date and news fields. For the date type I've tried a couple of different methods but find it displays incorrectly (year-day-month) and i'd like to change this to day-month-year. I downloaded an DW extension that had been used in a magazine article but it now displays all dates as 01/01/1970 so have hit a bit of a wall!
I'm a full on php noob so might struggle with the hard coding but am willing to have a go!!
Thanks!!!
Fortunately MySQL provides a powerful function named "date_format", so just have a look at http://www.dan.co.uk/mysql-date-format/ where you´ll find lots of well explained examples which utilize this function.
The third date formatting example (%d/%m/%Y) is already pretty close to the format you´d prefer, the only thing you´d have to do is replacing the forward slashes (/) with hyphens (-)
Cheers,
Günter
Similar Messages
-
How to print formated data/report on client's printer (Web Application)
Hi All
I want to print some formatted data/report ( it might be 1000 pages) on user's printer.
Application is web based
Technology used are Java - jsp - servlets
i want functionality like...
when user click on print button/link, data is fetched from server and all pages (it is formated data so i want alignment on page while printing) should be printed one after another.
Also printer selection dialog should displayed one time when user click on print button/link.
Questions:
1. How i will transfer all data to client (web browser) from the server ??
2. And how i can print that data on user's printer ??
There is requirement (or limitation) that I can not use applet for this purpose.
And also it is not fix that we must use java tech., we can use any othere tech. but condition is that it must support multiple platform (in short platform indipendant)
There is solution like ...
I can use window.print() function of DOM/JavaScript,
but it prints only one page which is displayed on browser.
I don't want to display any page. and want to print all pages.
if any one done or have idea then let me know.
Thanks in Adv.
Shailesh Koradiyathanks linxpda for reply,
we can use ActiveX component for windows platform for printing purpose, same way we can use platform specific component for printing... (for linux, unix, sun solaris etc...)
if it is possible then let me inform.
Thanks,
Shailesh Koradiya -
How to print formatted data / report on user's printer in Web Application
Hi All
I want to print some formatted data/report ( it might be 1000 pages) on user's printer.
application is web based and tech. used are Java - jsp - servlets
now prob. is ...
how i will transfer all data to client (web browser) from the server and how i can print that data on user's printer ...??
there is requirement that I can not use applet for this purpose.
if any one done or have idea then let me know.
thanks
Shailesh KoradiyaHi
Its simple, first of all break ur data in terms of pages. Write the logic in one JSP.
suppose i have jsp PrintReport.jsp , for page 1 url will PrintReport.jsp?page=0 ... so on
get the page parameter in JSP
String page="";
if(request.getParameter("page")!=null)
page=request.getParameter("page");
get the rowcount from the Result and assume records per page is 100
if u have 1000 rows then 10 pages u have to serve
StartRowNumber=page*recordsPerPage
EndRowNumber=StartRowNumber+recordsPerPage
Execute a SQL query , select * from table where rownum between
StartRowNumber and EndRowNumber
Provide google like pageNumbers in ur HTML page
ie 1 2 3 4 5 6 ..10
Regarding printing , Create HTML button called 'print' and add Javascript ' window.print()' on clicking it.
Hope it would solve ur problem
Cheers
Rajendra Bandi -
Error When Refresh Formatted Data inside Excel Analyzer
I have build a Excel template and load up this to the BI Publisher Server. When I call this template after the log in works fine. When I refresh the data normal it works also fine, but when I try to refresh formatted Data I get the error "Error: This report does not support HTML as an output format." I will not use html output inside Excel, I will use the original Excel template with refreshed data.
Hi Tim,
The Refresh Formatted Data works on MS Excel 2003.
May need to check if its really supported on MS Office 2002.
Btw another question, is it possible to create an excel template without using Excel Analyzer?
Also when I used the generated excel file of Excel Analyzer as template, when the report is generated the data sheet sometimes is not filled with correct data or sometimes there is no data at all, even if the parameters used is the same as the one used in generating the original excel file using Excel Analyzer. This happens most of the time for reports with Concatenated Queries or SQL Queries using "CURSOR" to group a set of data. Note that on initial generation of excel file using Excel Analyzer, correct set of data is displayed. It is only when it is used as template and viewed/exported in Excel format that data is not properly loaded.
Please advise.
Thanks!
Uniz -
Error in outputting xml formatted data
Hello,
I'm trying to output xml formatted data using apex.
At about 70% into the formatted output I get this in the browser:
<descript>punct= & > < /,() &</descript>
</row>
- <row The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
Only one top level element is allowed in an XML document. Error processing resource 'http://apex.oracle.com/pls/otn/f?p=158...
<script language="JavaScript1.1" type="text/javascript">
-^
m">>
<DIVI have a 600 row table (dml below) with identical string in each row of the descript column. (I put in some special characters just to push it through the escape function for html. It is displaying the text correctly.)
The page has one report region (plsql below).
The page template is stripped down.
My local results are identical to the otn hosted workspace.
I did dump the table in xml format and displayed the dump file in browser without a problem, so I'm missing something in the code.
Thank you.
Albert
On OTN webspace, go to http://apex.oracle.com/pls/otn/f?p=15866:1:1291425545573680200:::::
plsql
declare
xdescript varchar2(4000);
begin
-- xml preface is in the page template
-- htp.p('<?xml version="1.0"?>');
htp.p('<rowset>');
begin
for item in
(select descript,cid from receipts order by cid)
loop
htp.p ('<row>');
xdescript := htf.escape_sc(item.descript);
htp.p('<cid>' || item.cid || '</cid>');
htp.p('<descript>'|| xdescript || '</descript>');
htp.p('</row>');
end loop;
end;
htp.p ('</rowset>');
end;
dml
CREATE TABLE "RECEIPTS"
( "CID" NUMBER,
"AMOUNT" NUMBER NOT NULL ENABLE,
"CLEARED" DATE,
"DESCRIPT" VARCHAR2(80),
"DATEENTERED" DATE DEFAULT SYSTIMESTAMP,
"CHECKNBR" NUMBER,
"CLEARSEQ" NUMBER DEFAULT 0,
CONSTRAINT "RECEIPTS_PK" PRIMARY KEY ("CID") ENABLE
CREATE SEQUENCE "RECEIPTS_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999
INCREMENT BY 1 START WITH 4319 CACHE 20 NOORDER NOCYCLE
CREATE OR REPLACE TRIGGER "BI_RECEIPTS"
BEFORE INSERT ON "RECEIPTS"
FOR EACH ROW
BEGIN
SELECT "RECEIPTS_SEQ".NEXTVAL INTO :NEW.CID FROM DUAL;
END;
ALTER TRIGGER "BI_RECEIPTS" ENABLE
/May be it helps you. I use SQL/XML and APEX Application Process to generate XML succesfully
Here is the result:
http://htmldb.oracle.com/pls/otn/f?p=9774:101:0:APPLICATION_PROCESS=RSSNEWEVENTS
and here is the Process Text source:
declare
a clob;
begin
owa_util.mime_header( ccontent_type => 'text/xml', bclose_header => TRUE, ccharset => 'utf-8');
htp.prn('<?xml version="1.0" encoding="UTF-8"?>');
select
XMLTYPE.getStringVal(
XMLElement("rss",
XMLAttributes('2.0' as version),
XMLElement("channel",
XMLConcat(
XMLElement("title",'iActiveLife - novinky'),
XMLElement("link",'http://www.iactivelife.cz/'),
XMLElement("description",'iActiveLife - Zajímavý ivot snadněji'),
XMLElement("language",'cs'),
XMLElement("pubdate",''),
XMLAgg(
XMLElement("item",
XMLConcat(
XMLElement("title",event_name),
XMLElement("link",'http://htmldb.oracle.com/pls/otn/f?p=' || v('APP_ID') || ':37:' || v('SESSION') || '::NO::P37_EVENT_ID:' || event_id),
XMLElement("description",'')
) into a
from (
select event_id,event_name,issue_date, last_update_order
from (
select events.event_id, events.event_name, events.issue_date, rank () over (order by events.issue_date desc) as last_update_order
from events
where exists ( select * from opportunities where events.event_id=opportunities.event_id and opportunities.user_id is not null)
order by events.issue_date desc)
where last_update_order<=10
htp.prn(a);
end; -
How to use format-date with the report parameter
Hi all,
How to use the format-date function with this tag,
<?param@begin:P_FROM_DATE?><?$P_FROM_DATE?>
this form date is coming from report parameter and is coming like this 2012/11/01 00:00:00.
So now i need this in DD-MON-YYYY fromat.I tried like this <?param@begin:P_FROM_DATE?><?$format-date:P_FROM_DATE;'DD-MON-YYYY'?>
but its giving error. Can any one pls tell how to convert it to customized date format.
thanks & Regards
Srikkanth.MIssue solved.
Ref this link
XML date Format -
How to use many format data into a template?
How to design a template but it can interface from many format data?
This is the one from 2010 but should still work.
http://www.bfcnetworks.com/blogs/alexpearce/pull-sharepoint-2010-document-properties-into-word-quick-parts/
You basically create a new document in the library (must have the columns you want into the word document), then you use the Quick
Parts to insert the data where needed. Then you save this document as your template. Then anytime someone creates a document in the library when you open the document it will read from the columns of the item.
I used a workflow and had the users actually update a SharePoint list, then that in turn creates a new document in the document library and populate the columns from the list form. Then You can send that document link to folks to download / print or whatever.
Is that what you are talking about? -
Formatting dates in a table in webdynpro java for mutliple entries.
Hi all,
I have a requirement to format date values in a table for multiple entries to dd/MM/yyyy format in webdynpro java for mutiple line items in that table.
Please help me out with the technique for the same.
Thanks and Regards,
Soumyadeep.Hi,
here is the code for changing the formatting the date.
Date currentDate = new Date ();
DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
String today = df.format(currentDate);
SimpleDateFormat sdfInput = new SimpleDateFormat("dd/mm/yyyy");
SimpleDateFormat sdfOutput = new SimpleDateFormat ("mm/dd/yyyy");
try {
String dateft = sdfOutput.format((Date) sdfInput.parse(df.format(currentDate)));
} catch (ParseException e) { -
Format Date function not working correctly
Hi,
I am using the following code to display a system date:
<?xdofx:sysdate('DD-Month-YYYY')?>
However the date always appears as:
18-March -2011 (with space after 'March')
rather than
18-March-2011 (no space after the month)
Can anyone tell me how to get the date to display without the space after the month?
ThanksSome options:
http://winrichman.blogspot.com/2008/08/xslt-extended-functions.html (right side screen shot)
BI Publisher:formating date using xdofx
Modify the output from current_date -
Format Data doesn't work?
Hi
I want to see numbers in Discoverer formatted as set in Administrator, which is
999G999G990D99.
The Format Data dialog box tells me that 'Default' formats numbers as they have been set up by your Discoverer manager, using the format 9999999999.
Only, I am my own Discoverer manager and I set up 999G999G990D99.
I can find that setting in EUL5_EXPRESSIONS.IT_FORMAT_MASK and I can see changes done with Administrator.
Why don't they show up in Discoverer?
Hints appreciated
FranziskaInstead of selecting 'Default' go to more Number
formats and seelct the one you want.In which dialog do you find these 'more number formats'?
That will become the new default format.I need different formats for different columns. So one default won't do.
Hope this helps!Afraid not.
Thanks
Franziska -
Issue with format: date dd-MMM-yyyy - First letter lower instead of capital
Hi colleagues,
I am facing a problem using: <?format-date:FIELD_NAME;’dd-MMM-yyyy’;'UTC'?> on my RTF template.
When the report run on English it retrieves: Apr, Jun, ...
but in French it retrieves: apr, jun.
The client wants the first letter of the month in capital letter I thought that MMM is the format to manage it...
I am using XML Publisher with PeopleSoft.
The template is in French and using bursting I create the report in different language depending on some parameters.
When I preview the template everything is ok.
Does anyone knows where is the Abbreviate Name of the Month comes from?
Thanks in advance,
Juan DiegoHi Juan
It ought to be returning 'Arv' not 'apr' in French right?
It might be an issue with the i18n library that is being shipped. I would suggest logging a service request with support for some help.
Regards
tim -
Problem formatting date.
I have a problem in validating and formatting date input by the user. The user input format is dd-MM-yyyy. I have to validate it and format it to dd-MMM-yy format. I tried the below code.
import java.util.*;
import java.text.*;
public class DateFormatter{
public static void main(String[] args){
String str = "24-12-20gg";
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
try{
sdf.setLenient(false);
Date date = sdf.parse(str);
System.out.println(date);
}catch(Exception e){
System.out.println(e);
The above code parses the date as - Tue Dec 24 00:00:00 IST 0020 . I want to throw an exception if it is not a date and is not of four digits. Any solution ?.Why not Java support such things. This will help to avoid reinventing the
wheel.Java does support such things; there is no need to reinvent the wheel. Example:
import java.text.*;
import java.util.*;
public class DateParseDemo {
public static void main(String[] args) {
new DateParseDemo().go();
public void go() {
String format = "dd-MM-yyyy";
String goodDate = "24-12-2003";
String badDate = "Dec 24, 2004";
if (dateIsValid(format, goodDate)) {
System.out.println("\"" + goodDate + "\" is valid!");
if (!dateIsValid(format, badDate)) {
System.out.println("\"" + badDate + "\" is NOT valid!");
public boolean dateIsValid(String format, String date) {
boolean valid = false;
DateFormat df = new SimpleDateFormat(format);
Date parsed;
try {
parsed = df.parse(date);
valid = true;
} catch (ParseException pe) {
// log exception
return valid; -
Function Modules for Format Date, Month Name and Quarter value.
Hi All,
1. I am getting the date field from the Flatfile, so i need to format the date to YYYYMMDD. Is there any Function module for that in BW.
2. Based on the above Formated Date i have to find out the Name of the Month like JANUARY, FEBUARY etc.
3. Based on the same above Formated Date i need to find out the Quarter like 1, 2 etc.
Could you please let me know if any function modules are there for the above questions in BW not in ABAP, why i mention is some Function modules are there in ABAP but not in BW.
Thanks in advance.
Regards,
srinivasHi ,
1.If your input date format is MMDDYYYY then Use SDATE as conversion routine in trans strucutre to convert into YYYYMMDD.
2.By passing year as input parameter for the following FM you would get all the months with text.Using READ statement in routine you can get month name
MONTH_NAMES_GET
3.For Quarters you can use the following FM:
TSTR_PERIODS_QUARTERS
hope it helps...
regards,
Raju -
I have an BI Publisher parameter
<?P_INVOICE_BEGIN_DATE?>
It displays like this:
1988-10-01T00:00:00.000-04:00
How do I display it like this:
01-OCT-1988
Thanks!<?format-date:P_INVOICE_BEGIN_DATE;’dd-MMM-yyyy’?>For ex:
<?format-date:’2007-07-01T00:00:00.000-06:00’;’DD-MON-YYYY’?>
you get 01-Jul-2007 as output. -
Date prompt to displayed in header&Format date format in header MM/DD/YYYY
we have a date prompt. Based on the date selection on prompt, it has to be appeared on the Report header. Actually RELEASED_DATE is timestamp format. we need to format this to dispaly only MM/DD/YYYY format in Report header section.
Report Name : <?$RELEASED_DATE?>
We are displaying the same RELEASED_DATE with timestamp in Report section
<?param@begin:CRSU_RELEASED_DATE?>can you paste the timestamp being displayed?
You can use, format-date function or other, but its all based on the data you have for DATE. -
In What Format datas are stored in the LabView???
Hello Friends
In what Format datas are stored in the Labview.Likewise Icon,Text format Etc.
JayavelData Types :
http://zone.ni.com/reference/en-XX/help/371361B-01/lvexcodeconcepts/manager_data_types/
Data Logging :
http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/choosing_a_file_i_o_format/
Maybe you are looking for
-
what a crock of crap i tunes is followed instructions to get music off i pod on to new laptop lost 5.2 days of music can any one help please ?
-
I have an Inoi NAS hard drive connected to my network using SAMBA. When I try to connect on my MacBook or another MacBook Pro, opening certain folders causes the Finder to crash. Same folder does it on both machines. However, on another Windows lapto
-
How do I play an .flv file ?
I got an email with a .flv attachment. I understand this is a flash file. What do I need to do to play this file? Windows XP 32 bit Your site check says I have flash version 10.1.53.64 I never explicitly installed flash, I understand it came bundled
-
Mountain Lion won't let my computer boot..
I installed mountain lion, and it installed then when I restarted it, it sat at the gray Apple boot screen. I held option and ran disk utility to repair anything and nothing was wrong. Now I held option again and am using the "search the internet for
-
Can anyone help me reset my pod? It is stuck on the plug in to itunes picture. (the usband itunes logo) When i plug it in to my computer, it says it has a passcoe but i do not know what to do.