UNIX timestamp in cfgrid controls
Some time ago I realized a php and SQL construction. Users to apply for jobs, and the date they charge is converted into a unix timestamp and inserted in the SQL code as an integer.I use coldfusion more now and I'm wanting to display the results above using a cfgrid.
I found similar posts in this forum, but I have still two EXTERNAL queries:
(1) how do I get the date for each line before the controls cfgrid poster
(2) how to convert unix timestamp using coldfusion
chilliroom wrote:
> However, the column is reading entirely the same value, I
> calculated as the date of the last record.
because you're not advancing through your query. I guess that the stripped News
on the hooks for applicants.posted [i]. lets see if the cf tags get
Thru:
Tags: ColdFusion
Similar Questions
-
11 ColdFusion Flash bashing is this used to replace the cfgrid controls?
We have recently updated to CF8 CF11. Is about to create interfaces with several new databases. To do something like CFGRID controls in new forms, but given that it's a Flash form component and Flash forms are deprecated in CF11, what is the alternative to forms no Flash for those who need a sub-shape with add/CHANGE/REMOVE features such as controls CFGRID? Looks like that characteristic of the worksheets is just for output/display of the data, not data entry.
Thank you, Carl. I noticed that jQuery seems to be the answer. I just wanted to check that I was not overlooking something in the new version.
-
Data binding conditional with cfgrid controls?
I have the following:
< action = "action.cfm cfform" format = "flash" method = "post" > "
< cfformgroup type = "horizontal" >
< cfformgroup type is "page" label is "Email" >
< name cfgrid 'email' query = 'email' = >
< name cfgridcolumn 'question' = >
< / controls cfgrid >
< / cfformgroup >
< cfformgroup type is "page" label is "Paycheck" >
< name cfgrid = 'paycheck' query = 'paycheck' >
< name cfgridcolumn 'question' = >
< / controls cfgrid >
< / cfformgroup >
< / cfformgroup >< cfformgroup type is "Panel" label is "Response" >
< cfformitem type = bind "html" = "{((email.selectedItem.question == undefined)?": email.selectedItem.answer)} "
(paycheck.selectedItem.question is undefined)? ('': Paycheck.SelectedItem.Answer)} "> < / cfformitem >"
< / cfformgroup >< / cfformgroup >
< / cfform >I assume that there is a syntax error in the value of the BINDING of the CFFORMITEM tag attribute. In plain English, I'm essentially looking to say (and I'm simply not enough experience with ActionScript for how to do this):
If a line in the cfgrid controls named, 'email' is selected, make the value of the column in the query response to send the value of the CFFORMITEM tag. Otherwise, if there is a line in the named cfgrid controls, 'paycheck' that has been selected, make the colum on the wage response value query the value of the CFFORMITEM tag.
TIA
The way that you have written, undefined is a variable name. I think you meant the "undefined" value instead. Looking for something like this?
-
Find the elapsed time between the Unix Timestamp in Actionscript 2.0
Hello!
I'm tryin to fiind that time passed since a Unix Timestamp.
I have this:
var myTime:Date = new Date(1245859691 * 1000); nowTime = new Date(); oMillisElapsed = new Date(nowTime - myTime); day = numToStr(oMillisElapsed.getDate()); min = numToStr(oMillisElapsed.getMinutes()); sec = numToStr(oMillisElapsed.getSeconds()); hour = numToStr(oMillisElapsed.getHours());
But oMillisElapsed returns: Wed Dec 31 23:20:43 GMT - 0800 1969
So he keeps time from 01/01/1970... Any way to make it back to something like this:
Mon Jan 02 01 1:2:35 GMT - 0800 0000
or something like that so I can get the days, hours, minutes and seconds.
I use actionscript 2.0.
Thank you!!!
~ Sea4Me
You assign a new Date value, so when you try to use the Date function to get its data, you get that produce these functions, which isn't what I want. I believe you want to get the amount of time (days, hours, minutes, etc.) between yesterday and today. Have you tried to do what I suggested? What you will eventually do takes the miiliseconds resulting from that and do the conversion in days, hours, seconds, etc...
-
Date of the Oracle in unix timestamp
Hello..
1. What is the command to convert oracle date to unix timestamp?
2. What is the command to convert oracle unix timestamp date?
It's my request of conversion, but when I converted from date oracle on another server time become a late hour. Why this happened?... y at - it no problem on the configuration of my sessiontimezone or dbtimezone?
create or replace FUNCTION oracle_to_unix
(
in_date IN DATE)
RETURN NUMBER
IS
BEGIN
RETURN (in_date-TO_DATE('19700101','yyyymmdd')) * 86400 - TO_NUMBER (SUBSTR (TZ_OFFSET (sessiontimezone), 1, 3)) * 3600;
END;
Please help me...
Thank you
BalleurHello!
If I subtracted something and then add the same then I should get the same result.
I tried like this
SQL> select sessiontimezone from dual; SESSIONTIMEZONE --------------------------------------------------------------------------- +01:00 SQL> select dbtimezone from dual; DBTIME ------ +02:00 SQL> select (to_date('14.03.2010 08:16:22','dd.mm.yyyy HH24:mi:ss') 2 - to_date('01.01.1970 00:00:00','dd.mm.yyyy HH24:mi:ss')) * 24 * 60 * 60 3 - TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))*3600 utim 4 from dual 5 / UTIM ---------- 1268550982 SQL> select to_char(to_date('01.01.1970 00:00:00','dd.mm.yyyy HH24:mi:ss') + 2 (1268550982+TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))*3600) / 24 / 60 / 60, 3 'DD.MM.YYYY HH24:MI:SS') from dual 4 / TO_CHAR(TO_DATE('01 ------------------- 14.03.2010 08:16:22 SQL>
and he seems allright for me.
Check sessiontimezone sessions on both servers. This calculation depends only on sessiontimezones.T
-
using href inside cfgrid controls
I have a cfgrid that is simple with a single column of information is returned. I need to make a link for each entry in the returned column (each entry will be a unique bond based on the information returned by the query). I don't know how to really get into it. I played with the href, selectmode, selectcolor attributes in cfgrid controls and the select attribute in cfgridcolum. But I'm not really understand - can someone direct me to a tutorial?Thanks, but I decided to go in a different way - so be it.
-
I am looking for a way to convert a time value UNIX (1201900638) so that it generates a ColdFusion page in the format mm/dd/yyyy. Anyone would be able to help with that?
Thank you...
According to the time Unix the number of seconds elapsed since midnight time coordinated universal (UTC) of January 1, 1970, not counting the seconds dividers... The number of time Unix sucks at the time Unix and increases by exactly 86 400 per day since the time
As a result, January 1, 1970 + (1201900638 / 86400) = February 1, 2008
What is the date that is the number of "UNIX time" you have posted?
According to the unix timestamp and epoch conversion tool, 1201900638 is equivalent to the following:
GMT: Friday, February 1, 2008 21:17:18 UTC
Your timezone (PDT): Friday, February 1, 2008 13:17:18Try this:
#DateConvert ("utc2Local", DateAdd ("s", 1201900638, CreateDate("1970","01","01"))) #.
Where CreateDate() converted to a date/time on January 1, 1970, Functionadds with a parameter of "s" Add 1201900638 seconds to l 'era' start date, and with "utc2Local" DateConvert() converts the time UTC to your local time.
You can then use the DateFormat() attribute to display in any format you want.
Phil -
Convert unix timestamp to date after the change to daylight saving time
Hello
in one of the products, we use internal Scheduler stores dates (and times) in a format Unix, which is seconds since January 1, 1970. We used this SQL to extract the effective date:
To_char (t.next_fire_time /(24*60*60*1000) + to_date('19700101020000','yyyymmddhh24miss'), 'yyyymmddhh24miss')
Everything worked well until that time has changed this weekend from UTC + 2 to UTC + 1 (we are located in Eastern Europe). Since then, the above query returns an hour later than planned.
I.e. of timestamp * 1320067800000 * is returned as * 20111031153000 * even thought is correct (and the actual time, the event was planned) * October 31, 11 PM 02.30.16.000000 *.
I found queries like this on various forums and nobody seems to care of DST. Is this a configuration problem in the DB or is this a bug in our code?
I tried selecting the SESSIONTIMEZONE and the DBTIMEZONE and both were + 1.
Any help appreciated.Your problem is coded hard 2 hours shift:
TO_DATE (19700101'020000', 'yyyymmddhh24miss')
You need to calculate the current offset to adapt it to the current situation of DST:
with sample_table as ( select date '1970-01-01' + 1320067800000 / 1000 / 3600 / 24 dt_utc from dual ) select dt_utc, dt_utc + extract( timezone_hour from from_tz(cast(dt_utc as timestamp),'utc') at time zone 'Europe/Prague' ) / 24 dt_prague, extract( timezone_hour from from_tz(cast(dt_utc as timestamp),'utc') at time zone 'Europe/Prague' ) tz_offset from sample_table / DT_UTC DT_PRAGUE TZ_OFFSET ------------------- ------------------- ---------- 2011-10-31 13:30:00 2011-10-31 14:30:00 1 SQL>
SY.
-
Convert the MySQL timestamp into a Unix timestamp field
I have a process where I want to compare the current date with an expiration date is so many months after the date of registration. The registration date is stored as a MySQL timestamp. I want to convert this to a timestame Unix I can do the comparison with the Time() function. I tried the MySQL UNIX_TIMESTAMP both getTimestamp() PHP functions and can not get to work. I tried UNIX_TIMESTAMP in both the original SELECT statement and a stand one. I also have an error of division by zero with date_default_timezone_set function. I am attaching the screenshots of the code and the result of the echo inside. Thank you!
You are far too complicated.
SELECT TO_DAYS (reg_date) - AS TO_DAYS (CURDATE ()) daysleft
OF ssregis
WHERE...
This will give you the number of days remaining before the expiry of the registration. If it is less than 0, redirect to the renewal page.
Moreover, you yourself laying wide open to attack by SQL injection by failing to escape at the entrance of the query string. At the very least, you should do this:
$entered_ss_id = mysql_real_escape_string($_GET['record_id']);
$entered_email = mysql_real_escape_string($_GET['email_address']);
However, since it seems that you are hand-coding the script, you must use MySQL improved rather than discouraged PHP MySQL functions. See http://docs.php.net/manual/en/mysqlinfo.api.choosing.php.
-
How to alternate the color of the lines in the html cfgrid controls
Hi all
How can I alternate the color of the lines in html cfgrid?
I do not have access to CFIDE/scripts/ajax/resources/ext/css/ext-all.css which is where the css styles are preserved according to firebug
Thank you
goodychurro1 wrote:
How can I alternate the color of the lines in html cfgrid?
Hi goodychurro1,
The cfgrid attribute you're looking for is "striperows. Optionally, you can also use the attribute "striperowcolor". Regarding your question in the other thread on link href/selection of a grid, you can use the following block of cfscript to create the query of 'q' in the example I posted in the other thread (if you're not on CF10).
q = queryNew ("myID, myString", "integer, varchar");
queryAddRow (q, 3);
querySetCell (q, "MyID", 1, 1);
querySetCell (q, "MyID", 2, 2);
querySetCell (q, "MyID", 3, 3);
querySetCell (q, "myString", "one", 1);
querySetCell (q, "myString", "two", 2);
querySetCell (q, "myString", "three", 3);
Reference:
Thank you
-Aaron
-
Conflicts with HTML-based CFGRID controls and prototype
Someone had problems with the help of the CFGRID based on HTML in a page using Prototype.js? We are currently using the prototype library for the manipulation of some of our functions of banner on our pages, but when I use the cfgrid html-based data is displayed if you click on a column header. On load/refresh the page, without rows of data are displayed. I think it may be related to refresh in contradictory cfgrid with a prototype, but I'm only guessing. If I remove the Prototype include file from the page, and then run the cfgrid normally controls screens. Any ideas?You can post your bug here,
-
Hello
I use developer SQL to query an oracle 8 database and
I need to convert a timestamp unix in a time format date - YYYYMMDD HH24:MI:SS
I am currently using
, to_date (19700101' 00:00: 01 ',' YYYYMMDD HH24:MI:SS') + sh.order_date / 86400
but it returns just the date in the format DD-MMM-AAIf you want a DATE to look a certain way, use TO_CHAR
to_char ( to_date('19700101 00:00:01','YYYYMMDD HH24:MI:SS')+sh.order_date/86400 , 'YYYYMMDD HH24:MI:SS')
-
bind the cfgrid controls to an another cfgrid
I have a cfgrid;
< cfgrid name = "CompQry" format = "html" pagesize = "10" striperows = "Yes" height = "320" width = "580" font = "Verdana, Arial, Helvetica, sans" fontsize = "12" align = "left" bind="cfc:/components/tsiadmin.getCompanies ({cfgridpage}, {cfgridpagesize}, {cfgridsortcolu minutes}, {cfgridsortdirection}, cname # #)" selectmode = selectonload 'row' = "true" > "
< name cfgridcolumn = "CompanyRecordNumber" header = "Number of Comp" select = "yes" >
< cfgridcolumn name = 'Name' header 'Name' = >
< name cfgridcolumn = 'City' header 'City' = >
< name cfgridcolumn = 'State' header 'State' = >
< / controls cfgrid >
And I need to link the selected line to another grid;
< cfgrid name = "IndivQry" format = "html" pagesize = "10" striperows = "Yes" height = "320" width = "580" do = "Verdana, Arial, Helvetica, sans-serif" fontsize = "12" align = "left" bind = "" selectmode = selectonload 'row' = "true" > "
< name cfgridcolumn = "IndividualRecordNumber" header = "Number of single" select = "yes" >
< name cfgridcolumn = "First name" header = "First name" >
< cfgridcolumn name = "LastName" header = "Last Name" >
< / controls cfgrid
The first grid is a list of the companies and the grid secord is supposed to be a list of all the selected company. I see that I have a piece of code is missing. I don't see how I can bind to a cfc on the second grid which will be returen a query based on the selected line in the first grid.
larksys wrote:
> I don't see how I can bind to a cfc on the second grid which will be
> returen a query based on the selected line in the first grid.
>
>
>see if this helps:
http://www.coldfusionjedi.com/index.cfm/2007/8/9/reacting-to-grid-row-selection--
Azadi Saryev
SABAI - Dee.com
http://www.SABAI-Dee.com -
Why the page automatically scrolls to the cfgrid controls
I have a page that is large enough so that it scrolls vertically. When it finishes loading, the browser scrolls automatically to the bottom of the page where a cfgrid element. It happens in IE, Chrome, and Firefox.
I reduced the cause down to the JavaScript server ColdFusion 11 adds at the top of the page. If I disable scripts in the browser, the page does not automatically scroll down.
Addition of window.scrollTo (0,0) at the onload of the body does not work. What JS is scrolling down occurs after the onload event. I have not tried. ready() jQuery yet; in the hope there is a fix.
Has anyone else seen elsewhere and don't know a fix or a workaround?
I found that the solution is to add the attribute selectOnLoad = "false" to the cfgrid tag. Its default value in CF11 is 'true '. I'm not sure CF10, but in CF9 is seems to default to 'false '.
-
file server Unix and Jython error control
Hi all
For windows with the local agent I use this suite
What is the sequence of commands will be replaced for the above files to UNIX servercmd /c dir c:\my_directory\*.* /b /a:-d > c:\my_directory\All_Files_Names.txt
Thank youI really think you need to create a script for this command.
create a get_cvs_files.sh file and copy / paste the following content:
#!/bin/sh ls -1 /n01/app/oracle/product/odi/files/*tracking.csv > /n01/app/oracle/product/odi/files/All_Files_Names.txt
Then run
chmod +x get_cvs_files.sh
to allow the execution.
Maybe you are looking for
-
BIOS flash for Satellite A20-S103 necessary
Hello I need a flash BIOS for laptop Toshiba Satellite A20-S103. I have already downloaded on the download site.But this one I can't use because I need windows must be installed. And that's the problem.I can't install windows because the BIOS is not
-
set the load of SQL to Essbase Cube
Hi, I have a cube ASO which I load the data using SQL. The database user id and password changes every quarter. I wanted to make the load demand... so I want to know if theres any way I can set the user name and password for the SQL code in the file.
-
G60 play you tube videos distorted
My computer is about 1 month, Ive noticed over the three days - youtube several videos play distorted with a green screen or simply stained to the top of the audio is fine. I thought at first it was the video itself, but do a check for one of my sit
-
I bought and downloaded 6 Lightroom in January and everything worked well until the beginning of this week. Since then, I had problems with the import function. I tried to import pictures of two different cards, office, USB keys and external hard dri
-
Hi, Im a beginner with the Add - ons. Where can I download my addon '725 + Pro Presets Bundle'?