Change formatting dates with GREP
I am laying out a book with thusands of dates all formatted e.g 02-03-1913. I want to hange these to (eg) 2nd March 1913. I expected it to be a lengthy, staged, operation. But I cannot get GREP to recognise specific numbers (e.g. 02) If worked through logically I did think I could do it in stages. Can anyone help?
Hi,
Using Multi-Find/Change, 12 regex, 1 set. So, 1 click and done!
1/ Search: (0?)(\d+)-01-(\d{4})
Replace by: $2~Sjanuary~S$3
2/ Search: (0?)(\d+)-02-(\d{4})
Replace by: $2~Sfebruary~S$3
12/ Search: (0?)(\d+)-12-(\d{4})
Replace by: $2~Sdecember~S$3
Similar Messages
-
hi,
who i can change format date in servidor ORACLE for all client?
Thank´sThe default format can be set by changing the NLS_DATE_FORMAT initialization parameter and restarting the database, alter system set nls_date_format = "YYYYMMDD" scope=spfile; and the database has to be shutdown and restarted to enforce the change. It might be alter database instead of alter system, I usually try the wrong one first.
But the setting can be overridden in the client setup or changed in a user session, there's no way to enforce a particular format on the client environment. -
Formatting Date with JavaScript
Hello guys,
is there a way to change the date format with JavaScript? I have a library with different fields.
I hope you can help me!
Best regards
MatthiasYes
Check below
http://www.bentedder.com/convert-a-sharepoint-datetime-field-to-a-javascript-date-object/
function convertSPDate(d) {
* A function to convert a standard SharePoint
* date/time field (YYYY-MM-DD HH:MM:SS) to a
* javascript Date() object
* Author: Ben Tedder (www.bentedder.com)
// split apart the date and time
var xDate = d.split(" ")[0];
var xTime = d.split(" ")[1];
// split apart the hour, minute, & second
var xTimeParts = xTime.split(":");
var xHour = xTimeParts[0];
var xMin = xTimeParts[1];
var xSec = xTimeParts[2];
// split apart the year, month, & day
var xDateParts = xDate.split("-");
var xYear = xDateParts[0];
var xMonth = xDateParts[1];
var xDay = xDateParts[2];
var dDate = new Date(xYear, xMonth, xDay, xHour, xMin, xSec);
return dDate;
// create a couple of variables
var startTime;
var convertedStartTime;
// a standard SPServices call
$().SPServices({
operation: "GetListItems",
webURL: myListURL,
async:false,
listName: myListName,
CAMLRowLimit: 1,
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function(i){
// set the value of startTime to standard SP date/time field
startTime = $(this).attr("ows_startTime");
// set the convertedStartTime to a true javascript date
convertedStartTime = convertSPDate(startTime);
http://spservices.codeplex.com/wikipage?title=$%28%29.SPServices.SPConvertDateToISO
http://stackoverflow.com/questions/14283106/beginner-javascript-date-conversion-from-string-to-utc-date-js-into-sharepoint
http://stackoverflow.com/questions/14742625/how-to-convert-utc-date-by-javascript -
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 -
Formatting Dates with Javascript
Hi all. I'm tryign to find the solution on the web, but have
not had much
success yet.
I"m working on a customized button my my HTMLArea script that
puts a WYSIWYG
component on my form fields to insert the date.
My code is here:
editor.insertHTML((new Date()).toString());
Which outputs this:
Fri Nov 17 2006 10:08:35 GMT-0600 (Central Standard Time)
What I'm wanting to do is to output
Friday, November 17, 2006 with no timestamp, and no reports
of GMT/CST.
Any suggestions on where I can go to look? I've been at the
W3C, but I did
not see any way to format my string.
I've tried a lot of variations in trying to format the date
witha string,
but have not had any success.
This was my last script, which erred:
var d = new Date();
d.formatDate("D, M j");
d.toString();
editor.insertHTML(d);
TIA,
Jon Parkhurst
PriivaWeb
http://priiva.net.Thanks Mick, Reviewing now.
"Mick White" <[email protected]> wrote in
message
news:ejl3t8$sho$[email protected]..
> crash wrote:
>> Hi all. I'm tryign to find the solution on the web,
but have not had
>> much success yet.
>>
>> I"m working on a customized button my my HTMLArea
script that puts a
>> WYSIWYG component on my form fields to insert the
date.
>>
>> My code is here:
>> editor.insertHTML((new Date()).toString());
>>
>> Which outputs this:
>> Fri Nov 17 2006 10:08:35 GMT-0600 (Central Standard
Time)
>>
>> What I'm wanting to do is to output
>> Friday, November 17, 2006 with no timestamp, and no
reports of GMT/CST.
>
>
http://www.mickweb.com/javascript/dates/customDate.html
>
> editor.insertHTML(customDateString());
>
>
http://www.mickweb.com/javascript/dates/date.js
>
> function customDateString() {
> var now = new
Date(),H=now.getHours(),M=now.getMinutes();
> M=M<10?"0"+M:M;
> d =
>
["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
> [now.getDay()]+", ";
> d+=
> ["January","February","March","April","May","June",
>
"July","August","September","October","November","December"]
> [now.getMonth()]+" ";
> d+=now.getDate()+" "+now.getFullYear();
> d+=", "+H%12+":"+M+["AM","PM"][Number(H>11)||H==0];
> return d
> }
>
> Mick
>
>>
>> Any suggestions on where I can go to look? I've been
at the W3C, but I
>> did not see any way to format my string.
>> I've tried a lot of variations in trying to format
the date witha
>> string, but have not had any success.
>> This was my last script, which erred:
>>
>> var d = new Date();
>> d.formatDate("D, M j");
>> d.toString();
>>
>> editor.insertHTML(d); -
How can I change Time data with List Entry Screen ?
Hi expert.
I transfer Time Data (Infotype 2003) via CAT6.
When I go to transaction PA61 and click List Entry icon.
Record is display and cannot change data.
If I wanna change data.I must to click Choose Icon one by one record.
How can I change data with List Entry Screen?
ps. If record create via PA61. I can change data with List Entry Screen.
I can't change with record that create via CAT6.
Best Regards.have u tried to change your time entry through CAT2 tcode, ithink if u have created profile for time entry then it should allow you to change and you can use esc otherwise, its generally the standard profile given by SAP. but is 4 one user
hope this helps
guds -
Hi all...
I am trying dbms_random like this :
**Type data :
AAAA VARCHAR2(35)
BBBB VARCHAR2(6)
DDDD VARCHAR2(20)
E_DATE VARCHAR2(14)
**store procedur :
BEGIN
FOR X IN 0..3 LOOP
INSERT INTO TEST VALUES (
'AAAA--'|| dbms_random.string('X', 28),
'BBBB' || TO_CHAR (TRUNC(dbms_random.value(0,10))),
'CCCC--'|| dbms_random.string('X', 12),
TO_DATE(TRUNC(DBMS_RANDOM.VALUE(2455532,2455563+3)),'J')
END LOOP;
END;
Output :
AAAA BBBB DDDD E_DATE
AAAA--RTL2OWN8RVOMY1IUD93RP91RWOQA BBBB1 CCCC--JCWAXRO3TMP0 12-DEC-10
AAAA--629F3A4AIW5E4OHCDVFZ41SFB2U4 BBBB5 CCCC--DLAUZO511Y97 12-DEC-10
AAAA--XHKR95JISQRTRH54KNOQKDVUJ6QF BBBB6 CCCC--K7CHOT2KULNV 10-DEC-10
AAAA--7DRZ38SPRIN26HNA7VPQV9FKWCCQ BBBB7 CCCC--FXV3CCY3BWHY 09-DEC-10i want format E_DATE to DD-MM-YYYY without change type data and still use dbms_random...
Could you pls solve me out ?
Thank you
-newbie-pl/sql-Hi,
Sorry, I'm not sure I uderstand the problem.
Are you getting the date correctly, but you want to store it in a VARCHAR2 column? That's not a very good idea: dates belong in DATE columns, but if you ever want to convert a DATE into a string, use TO_CHAR:
TO_CHAR ( TO_DATE ( TRUNC ( DBMS_RANDOM.VALUE (2455532, 2455563+3)
, 'J'
, 'DD-MM-YYYY'
)or equivalently:
TO_CHAR ( DATE '2010-12-01' + dbms_random.value (0, 34)
, 'DD-MM-YYYY'
)Since you're not displaying the hours, minutes or seconds, there's no point in using TRUNC just to set them to 00:00:00.
Edited by: Frank Kulash on Feb 9, 2011 10:32 PM -
Formatting text with GREP or find/change
Hi,
Is there a quick find/changesearch or a GREP that I can use to format all the text that is inside a pair of pipes? For example "|Gone with the Wind|" would then be italicized.
I have over a hundred pages of text that has been placed inside these pipes, and had Microsoft Word find/replace to format them, but can't seem to figure out how to do it in InDesign.
thanks in advance,
LinaIf the pipes are not to be deleted - in this case GREP is not the best way. Try nested style instead:
Have fun -
Change format date for Calendar Prompt!!!
Hello there,
For a date prompt when I choose *"Calendar"* in my control, the default format shown by the calendar is d/mm/yyyy.
I want to save the value of my date prompt into a Presentation variable with the format yyyy-mm-dd. What conversion function can be used to achieve this?. In oracle the easiest way is TO_CHAR(dateHere,'YYYY-MM-DD') but when I apply this in the Edit Formula of the prompt it gives me an error.
I know the date format for a Calendar object can be changed in the configuration file, but I want to avoid this, because I might affect other users.
Please help.
Thanks
Edited by: PabloC2 on Feb 18, 2009 1:36 PMyes, I restarted presentation server and oc4j.
but has no effects.
date prompt has strange behaviour...
for Administrator user
in English locale
default format YYYY-MM-DD
after change date by calendar, it has M.D.YYYY format
in my locale
default format YYYY-MM-DD
after change date by calendar, it has YYYY.M.D format
for other users
in English locale
default format YYYY-MM-DD
after change date by calendar, it has YYYY.M.D format
in my locale
default format YYYY-MM-DD
after change date by calendar, it has YYYY.M.D format -
How to format date with in the file
Hi,
I have the below data in a file,
101 02100002111406893401207310900A094101xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5200xxxxxxxxxx D18000_1 CCDXXXXXXX JUL 31201207 1140689340000001
622113010547999999999003 000333333334RE 00030137 onee SYSTEM 0140689340000001
62200000 0000999999999001 0000011111CR460 00030135 twoo system 0140689340000002
82000000040015507087000000000000000003571110D18000_1 140689340000001
Can some one tell me how to read the date which is there in line 1 which is starting with indicator 1 at position 24 to 29
in this example it is 120731
which is in YYMMDD format
I want to replace from 70 to 75 with above date + 2 as 120802 in 2nd line which starts with indicator 5
My output should look like below in a file again
101 02100002111406893401207310900A094101xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5200xxxxxxxxxx D18000_1 CCDXXXXXXX JUL 31120802 1140689340000001
622113010547999999999003 000333333334RE 00030137 onee SYSTEM 0140689340000001
62200000 0000999999999001 0000011111CR460 00030135 twoo system 0140689340000002
82000000040015507087000000000000000003571110D18000_1 140689340000001
Can some one please tell me how to do this?
Appreciate your response.The following will help you to extract the date and perform an arithmetic function on a date:
olddate=$(head -1 myfile | cut -c 24-29)
newdate=$(date -d "20${olddate} + 2 days" "+%y%m%d")You may have to implement some logic if the year is before this century, e.g 1999. For the rest I suggest you look into awk or sed to perform a string replacement based on character position.
Edited by: Dude on Aug 7, 2012 12:57 PM -
Formatting DATEs with FORMAT clause and not with "to_date()" ?
Well I know I could format a DATE inline with the to_date() function.
But is there a way to format it in a separate FORMAT clause similar to
numbers?
If yes how would a format of
dd.mm.yyyy
or
yyyy.mm.dd hh:mm:ss
look like?user559463 wrote:
Ok, again I am searching something like
COLUMN "expiry" FORMAT "YYYY.MM.DD HH:MM:SS"No, it can only be done via TO_CHAR or NLS_DATE_FORMAT. I think you should read SQL*Plus COLUMN command.
SY. -
Errros in formatting dates with milliseconds
I am writing a routine to convert a String to a Date.
I have created the following mask: "yyyy-MM-dd HH:mm:ss.SSSSS"
I pass this to SimpleDateFormat and then parse to return a java.util.Date.
The method works fine when the milliseconds are all zero, ie .00012. however when the milliseconds increase, the resuting time in the date object becomes anywhere from a minute to hours later than it should be.
For instance, "2006-09-28 10:23:16.214500" becomes
Thu Sep 28 10:26:50 EDT 2006 when the resulting date object is displayed.
Is this a bug with java 1.5?OK thanks, so how would I convert the date string
provided, keeping the millisecond presision? What is
that number if not 21% of a second?Let's say you can get the fractional part (0.214500) into a double variable called fractionalSeconds. You do that part.
int milliseconds = (int) (fractionalSeconds * 1000); // or you might want to round this off - you figure that out
Now you have the number of milliseconds int the above variable. Format your timestamp using the original time string (less the fractional part) plus "." plus milliseconds. Then you could use the parser on that.
That said, I bet you could just get the timestamp as a Java date/time directly rather than parsing it as a string, since you mentioned you're getting this from a database query. -
Hi
There is a table with column datatype is varchar2(11) with data like
21-DEC-2010
22-DEC-2010
23-DEC-2010
28-DEC-2010
29-DEC-2010
29-DEC-2010
28-DEC-2010
29-DEC-2010
01-DEC-2010
28-DEC-2010
29-DEC-2010How can I put data in format 'DD/MM/YYYY' I tried with
select TO_date(t.nota_data,'DD-MON-YYYY')
from tb_carga_fat_suma tBut show me error message:
ORA-01843: not a valid monthSQL> with t as (
2 select ('21-DEC-2010') str from dual union
3 select ('22-DEC-2010') from dual union
4 select ('23-DEC-2010') from dual union
5 select ('28-DEC-2010') from dual union
6 select ('29-DEC-2010') from dual union
7 select ('29-DEC-2010') from dual union
8 select ('28-DEC-2010') from dual union
9 select ('29-DEC-2010') from dual union
10 select ('01-DEC-2010') from dual union
11 select ('28-DEC-2010') from dual union
12 select ('29-DEC-2010') from dual
13 )
14 --
15 --
16 --
17 select str
18 , to_char(to_date(str, 'dd-MON-yyyy'), 'dd/mm/yyyy') new_str
19 from t
20 /
STR NEW_STR
01-DEC-2010 01/12/2010
21-DEC-2010 21/12/2010
22-DEC-2010 22/12/2010
23-DEC-2010 23/12/2010
28-DEC-2010 28/12/2010
29-DEC-2010 29/12/2010
6 rows selected. -
Change creation date with Applescript? Any one?
Is any one good with writing AppleScript? I've looked in the Help menu and I don't understand it.
I have a folder of over 1,000 pictures that has the incorrect "Date Created." The correct date is actually in the "Date Modified" info for each picture. I have no idea how this came to be.
Given that there are so many files in the folder, using the "Touch -t" command in Terminal for each one individually is.. well.. daunting.
If any one knows how to write a quick Script to copy the "Date Modified" to the "Date Created" information going through each file in a folder (automated), karma would look good on you.
I've been going through page after page of web-search results of "change date created mac app" with no such luck.
(OS 10.8.2)
Thanks to any one that can help in any way.Hi,
touch -t can change the creation date, but it can only set backward, not forward.
Here is a AppleScript that uses the class NSFileManager from the Foundation framework to change the file's creation date.
-- this script set the creation date of each file to the file's modification date
-- When the dialog will appear, just select the files whose creation date is incorrect.
set pathErr to getFiles()
if pathErr is not "" then -- if error on some file
activate
display dialog "Done, but the creation date of some files have not been changed"
tell application "TextEdit"
activate
make new document at end of documents with properties {text:(" The creation date of these files have not been changed :" & pathErr)}
end tell
else
display dialog "The creation date of all the files have been changed."
end if
on getFiles()
script o
property tFiles : {}
end script
set o's tFiles to choose file with multiple selections allowed without invisibles
set t to ""
set tError to ""
set tc to count o's tFiles
repeat with i from 1 to tc
set t to t & " " & quoted form of POSIX path of (item i of o's tFiles)
if (i mod 250) = 0 or i = tc then -- 250 files sent to the shell to not exceed the limit of characters.
set r to my setCreationDateToModDate(t)
if r is not "" then set tError to tError & return & r
set t to ""
end if
end repeat
return tError
end getFiles
on setCreationDateToModDate(theseFiles)
do shell script "/usr/bin/env python -c 'import os, sys
from Foundation import NSFileManager
df = NSFileManager.defaultManager()
nbr=len(sys.argv)
for i in range( 1, nbr ):
f = sys.argv[i]
my_dict, error = df.attributesOfItemAtPath_error_(f, None)
if error is None:
mDate = my_dict.fileModificationDate()
cDateDict = {\"NSFileCreationDate\":mDate}
b, error = df.setAttributes_ofItemAtPath_error_(cDateDict , f, None)
if not b: print f' " & theseFiles
end setCreationDateToModDate
Works on OS X 10.5.x or newer. -
Problem with formatting date with JSTL ans swedish locale
Hi,
I have a strange problem with JSTL fmt:formatDate -tag and swedish locale.
-------------------------- Extract from the JSP ------------------------------
<jsp:useBean id="date" class="java.util.Date" />
<fmt:formatDate value="${date}" pattern="dd.MM.yyyy HH:mm" />
With en_US and fi_FI locales date is printed just the way I want: 29.04.2005 13:28 but in se_SE locale it is printed: Fri Apr 29 13:30:09 EEST 2005
Has anyone had this problem before?
Thanks in advance!Hi
Try using "sv_SE" locale.
Maybe you are looking for
-
DECODE OR CASE - Which is better and why
Oracle version: 11.2 Problem: We have a huge table with 10M records, which needs to be processed daily. While loading data in table we have to handle condition if flag is =1 then '111' else '000' To implement this which one is efficient solution? ..
-
Are there any other PPC operating systems
I would just like to know if there are any PPC operating systems I know theres the mac operating systems up to 10.5 and Ubuntu works with PPC Macs Is there anything other operating systems that work with ppc
-
i have created a web page. when i try to publish it i keeps giving me a window asking me to sign in to .mac account? i have done that allready? do i need to sync my .mac account? i tried that also and my computer won't let me sync? not sure why? is t
-
RAC -process failover at node crash
Hi, how to prevent running process(transaction) from termination in RAC while a node crashes .. Ex: if there is a process running on node 1 and if it suddenly crashes in RAC how does we make node2 or node3 to pick it up and process or start the trans
-
Help needed getting music from my ipod to itunes!
Please help! my computer got a virus so i had to reboot it. Now i can't get my ipod music onto my computer. The only place the music is stored now is on my ipod. What do I do?