» Home » FORMAT » Page 1
Date format in view returning unexpected format; correct format in console
by chadrico in Programming Languages

I am trying to format my dates in the YYYY-MMM-DD manner. I have a en.yml file that has it specified.

default: ! '%Y-%b-%d'

I have also created a date_time_formats.rb in my initializers folder.

Date::DATE_FORMATS[:default] = '%Y-%b-%d'
Time::DATE_FORMATS[:db]= '%Y-%b-%d'

I have also tried placing the

how to format short format date to short format in aspx code?
by Rineau in Programming Languages

In my aspx page I have repeater binding with date. It is showing full date and I want to format it to short date. Please guide me how to format date in aspx code (not in C# or Vb)

Here is my code:

<a class="CalendarLinks" href="readmore.aspx?wkdate=<%# Eval("cldID") %>">
<%# Eval("cldDate")%></a>

How to convert WriteableBitmap in RGB24 pixel format into a EmguCV image<Bgr, Byte> format?
by debuke in Programming Languages

I am trying to convert a WriteableBitmap which is having Rgb24 as a pixelFormat. I want to store the same image into a EmguCV Image having Bgr format. I have written a following code but it is not giving appropriate results.

public unsafe void Convert(WriteableBitmap bitmap)
byte[] retVal = new byte[bitmap.PixelWidth * bitmap.PixelHeight * 4];

how to get around “Single '}' encountered in format string” when using .format and formatting in printing
by Piriya in Programming Languages

I am currently trying to print a tabulated format (using left alignment and padding) for headings in a table however I keep getting the following error.

ValueError: Single '}' encountered in format string

Here's the line:

print("{0}:<15}{1}:<15}{2}:<8}".format("1", "2", "3"))

Required output is something along the

Persisting Currency format in Cocoa on a device that so easily could change Region Format
by kakashi_ in Programming Languages

I'm storing my currency values in NSDecimalNumbers (as recommended in multiple other threads on this forum) and using an NSNumberFormatter to display them correctly and handle the text input. All good! However, when I change the Region Format under iPhone prefs General settings to somewhere outside the US, say Germany, and then look at my app ALL my numbers have changed from $ to €. So an amo

How to create a User defined format in SAS DI Studio…Using Cntlin in Proc Format
by Rakewell in Programming Languages

I'm trying to convert a SAS code which creates a format in to SAS DI Jobs...
Here is the code that needs to be converted in to SAS DI job...

libname myfmt "&FBRMrootPath./Formats";
proc sort data=prd; by prd_nm;run;
data ctrl;
length label $10;
set prd(rename=(prd_nm=label prd_id=start )) end=last;
retain fmtname 'mealnm' type 'n';

Convert data from long format to wide format with multiple measure columns
by Chris Tattum in Programming Languages

I am having trouble figuring out the most elegant and flexible way to switch data from long format to wide format when I have more than one measure variable I want to bring along.

For example, here's a simple data frame in long format. ID is the subject, TIME is a time variable, and X and Y are measurements made of ID at TIME:

> my.df <- data.frame(ID=rep(c("A"

how do I add or subtract elapsed time from a date in the format yyyy-mm-dd hh:mm:ss and return result in the same format?
by Dean in Programming Languages

How do I subtract and/or add elapsed time to a date in the format yyyy-mm-dd hh:mm:ss?
ie how do I add 16:49:13 to 2012-06-18 22:03:18 ?

Also, how do I subtract 16:49:13 from 2012-06-19 14:52:31?
I need the results to be in the format hh:mm:ss

PHP: How to convert date+time in string format to format suitable for sorting data?
by Thaweesak Suksuwan in Programming Languages

I am loading articles from RSS and there is the date value formatted in various as:

January 4, 2013
Fri, 04 Jan 2013 13:18:05 +0000
Fri, 04 Jan 2013 07:33:51 EST
Jan 4, 2013
Fri, 04 Jan 2013 02:27:46 GMT

Is there any uniform way, how to save these values into the database column with datatype DATETIME, TIMESTAMP

Getting Warning like “Format not a string Literal and no format arguments”
by Oli in Programming Languages

Am getting the above warning at NSAssert(bgTask == UIBackgroundTaskInvalid,nil) line. Am working on Xcode4.5.1 with IOS SDK6.0. If any one know the reason, please let me know.

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .