formatting

Format date and time in a Windows batch script

喜你入骨 提交于 2019-12-16 23:38:52
问题 In a Windows (Windows XP) batch script I need to format the current date and time for later use in files names, etc. It is similar to Stack Overflow question How to append a date in batch files , but with time in as well. I have this so far: echo %DATE% echo %TIME% set datetimef=%date:~-4%_%date:~3,2%_%date:~0,2%__%time:~0,2%_%time:~3,2%_%time:~6,2% echo %datetimef% which gives: 28/07/2009 8:35:31.01 2009_07_28__ 8_36_01 Is there a way I can allow for a single digit hour in %TIME%, so I can

How to format only those records for which ORA-01843 is not thrown?

老子叫甜甜 提交于 2019-12-14 04:22:22
问题 I have a column with the below sample data. The data type of the column is VARCHAR2. 050211 042911 110428 110428 AO0102 JAN 31 FEB 01 When I try to format the column records in a readable format with below code, I am getting ORA-01843 : Not a valid month SELECT to_char(to_date(TRIM(MyColumn), 'YYMMDD'), 'MM/DD/YYYY') FROM MyTable; I believe ORA-01843 is thrown because of the records AO0102, JAN 31, FEB 01. How can I ignore those records(and may be just display its original value) which throw

excel conditional formatting with data

余生长醉 提交于 2019-12-14 04:11:15
问题 I am trying to format different columns of my excel sheet based on two conditions: if the cell does not contain the letter "u" or the letter "r" and if it is greater than a set number. For example, if I have a column of data, I would want 0.3 highlighted because it is greater than the set number of 0.00834 and does not contain U or R. I don't want 0.0071U to be highlighted or 0.0056J. Any help? 回答1: Select the cells/column(s) you want the conditional format applied to (for this example I

javascript date conversion showing wrong month

风格不统一 提交于 2019-12-14 04:05:19
问题 In the following date conversion after converting back the long integer The date says october instead of september var date = 2013-09-23 18:31 startdate = getTimeStamp(date); //1382533260000 Now t=1382533260000 rt = new Date(t) //Wed Oct 23 2013 18:31:00 GMT+0530 (India Standard Time) function getTimeStamp(strDate) { var a1=strDate.split(" "); var d1=a1[0].split("-"); var t1=a1[1].split(":"); var dtObj = new Date(d1[0],d1[1],d1[2],t1[0],t1[1]); return dtObj.getTime(); } 回答1: Months are zero

Formatting axis labels in lattice plot

↘锁芯ラ 提交于 2019-12-14 03:48:15
问题 How can I change the y-axis labels format to usual ( xxx.xxx ) instead of scientific, in the following plot? df <- read.table(textConnection(" ypogr_act amount cumSum 2012-09-20 30.00 30.00 2012-11-19 1834.69 1864.69 2012-11-30 2915.88 4780.57 2012-11-30 2214.98 6995.55 2012-12-18 21815.00 28810.55 2012-12-19 315000.00 343810.55 2012-12-21 1050.00 344860.55 2012-12-28 1300.00 346160.55 2013-01-10 1836.77 347997.32 2013-01-17 122193.00 470190.32 2013-03-22 415000.00 885190.32 ")->con,header=T)

Java: Print a 2D String array as a right-justified table

安稳与你 提交于 2019-12-14 03:42:31
问题 What is the best way to print the cells of a String[][] array as a right-justified table? For example, the input { { "x", "xxx" }, { "yyy", "y" }, { "zz", "zz" } } should yield the output x xxx yyy y zz zz This seems like something that one should be able to accomplish using java.util.Formatter , but it doesn't seem to allow non-constant field widths. The best answer will use some standard method for padding the table cells, not the manual insertion of space characters. 回答1: Indeed, if you

vb.net date formatting vs c# datetime formatting

跟風遠走 提交于 2019-12-14 03:35:42
问题 I am doing an Visual Studio vb.net WinForm App. I am used to work with c#. In C# Datetime DataType I have configured as "dd/MM/yyyy" as is configured in Control Panel and Regedit. In VB.Net, is different, when I create a Date variable like this Dim var As New Date var = DateTime.Now Date.Now returns format "mm/dd/yyyy". So every date format a assign to a variable, VB.Net automatically convert to format "mm/dd/yyyy". I need Date DataType in VB.Net to be configured as C#. I mean, "dd/MM/yyyy"

Powershell - remove currency formatting from a number

最后都变了- 提交于 2019-12-14 03:16:30
问题 can you please tell me how to remove currency formatting from a variable (which is probably treated as a string). How do I strip out currency formatting from a variable and convert it to a true number? Thank you. example PS C:\Users\abc> $a=($464.00) PS C:\Users\abc> "{0:N2}" -f $a <- returns blank However PS C:\Users\abc> $a=-464 PS C:\Users\abc> "{0:C2}" -f $a ($464.00) <- this works 回答1: PowerShell, the programming language, does not "know" what money or currency is - everything PowerShell

Powershell HTML Tables

独自空忆成欢 提交于 2019-12-14 03:15:49
问题 I am taking some information via Get-WmiObject: $logicalDisks = Get-WmiObject -ComputerName $cmpSys Win32_LogicalDisk Then creating some very basic HTML code to display it drive by drive: Foreach ($disk in $logicalDisks) { If ($disk.DriveType -eq 3) { $disksize = [math]::round(($disk.size / 1048576)) $freespace = [math]::round(($disk.FreeSpace / 1048576)) $percFreespace=[math]::round(((($disk.FreeSpace / 1048576)/($disk.Size / 1048676)) * 100),0) $body += @" <font color="red">Drive Letter: <

How to use Velocity NumberTool for big currency numbers

血红的双手。 提交于 2019-12-14 03:14:38
问题 I'm using the Joda Money.class for currency in my project. I'm using the NumberTool for formatting numbers inside a Velocity template. context.put("number", new NumberTool()); I convert Money values into ints for placing these values inside a Velocity template. example: // 123435 €1234.35 priceInCents = price.getAmountMinorInt(); I want to format this value inside the Velocity template as below: 1.234,35 How do I accomplish this? I tried the following cases: $number.format('#0,00', $price) /