Manipulation of date in Flex?

I found out how get the time UNIX in Flex. I do this by using the public service.


public function getUnixTime (): String {}
var myDate:Date = new Date();
var unixTime:Number = Math.round(myDate.getTime()/1000;)
Return unixTime.toString ();
}

So far, he doing it what I want it to do. But now I wanted to know, is it possible to get the consideration given readable to a UNIX timestamp date? If so, how?

For example:

1236268800 converts to Thursday March 5 08:00:00 GMT - 0800 2009 or vice versa.

http://NTT.CC/2008/09/04/AS3corelib-tutorial-how-to-use-DateUtil-class-in-Flex.html

should help you

Tags: Flex

Similar Questions

  • Manipulation of data and ReadFile

    Does anyone know a tutorial readFile manipulation and data?

    Utils.blobtoString still not working?

    Hello arqlz,

    The problem described in this article was due to a blobToString method unheeded at the time. This problem has since been apparently corrected. I just tested the following successfully on my PlayBook example.

    Note that before could run this sample, I had to manually create the file expected readme.txt on the PlayBook filesystem under:

    \media\downloads\

    To complete the above, I went in my PlayBook storage and sharing settings and active file sharing, and the sharing of the Wi - Fi (so I could create the live file on my PC). Then, I created the file manually and it filled with the text:

    Hello world!

    My file config.xml looks like this.

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0">
        Sandbox
        Oros
        
        
    
        
        
    
        
            access_shared
        
    
    

    Most of this is just a standard configuration.

    • The white list is not mandatory, but it is included by habit.
    • Blackberry.io.file feature > me provides access to readFile and saveFile.
    • The blackberry.utils me gives access to the blobToString and stringToBlob methods.
    • Permission to access_shared ensures that you can access the shared folder on the PlayBook.

    My gaze to index.html as follows file.

    
    
        
            
        
        
            

    From top to bottom, a brief description of the main parts:

    • The #log
      take our logging messages so that we can keep track of what's going on.
    • The / * global * / definitions are there just to satisfy JSLint. Basically, he announced that these variables are defined elsewhere.
    • The logarithmic function takes the text and adds in his own
      to #log. Reviews of find a large number of calls to this function scattered throughout the code. Basically, I want to keep track of what's going on. These calls are not necessary.
    • The handleOpenedFile function is called if we execute successfully blackberry.io.file.readFile. This is where we do our manipulation of data read. Manipulation converts the blob to string, inserts the text "update the:" to the chain, and then converts this string to a BLOB that is then saved in our output file: test.txt. "."
    • The ready function is called when the DOMContentLoaded event is raised. We provide our default readme.txt filepath then try to read the data.
    • Finally, outside functions, we record the DOMContentLoaded event to trigger our ready function. We place outside all functions to ensure the event is recorded when the
  • transmission of data to flex embedded swf

    I am trying to create a custom component in my flex application, which would imitate a progress bar. I intend to use it to show the progress being made on an investigation - for example: If the user answers to questions half the progress bar indicates half full.

    I am new to Flex and not to know of an easy way to do this without incorporation of a custom swf file. If I go this way is there a way to pass data from flex to my swf to update status? Or is there a way to do this directly in Flex?

    Thank you!
    Amanda

    You use that, or any other method and simply draw using the graphics/Sprite classes, or use something like Degrafa, Flex has a built-in progress bar. You can also integrate an AS3 SWF using SWFLoader, or as a SWC from Flash. This probably in the top 5 most frequently asked questions on this forum, so you should find something fairly quickly.

  • Problems with the removal of the data binding Flex to use Air 14

    Hello

    I was wondering if anyone had an optimal solution to replace the Flex Air 14 data binding classes. I can't merge the Flex and Air SDKS more for all liaison managers need to be replaced. Everybody runs into this problem yet? Automated link generation and manipulation was the best feature of Flex and now that it's broken it creates huge problems for me.

    It is Air of mobile and desktop applications. They still build everything simply no work of event management.

    See you soon,.

    Pete

    I forgot that I myself have solved last Dec. So basically from what I can tell that the precompiler is either no [Bindable] conversions so you must manually create the getters and setters for your model when it changes. I hope this helps anyone who may run into the same problem. There is literally no documentation on this wheres.

    i.e.

    [Bindable]

    public var username: String;

    becomes

    private var _username: String;

    [Bindable (= "propertyChange" event)]

    public function get username (): String

    {

    return this ._serviceState;

    }

    public function set username(value:String):void

    {

    var oldValue:Object = this ._username;

    If (oldValue! == value)

    {

    This ._username = value;

    If (this.hasEventListener ("propertyChange"))

    this.dispatchEvent (mx.events.PropertyChangeEvent.createUpdateEvent (Thi, "username", oldValue, value));

    }

    }

    You must also make sure that what ever class contains this property implements IEventDispatcher and has the following functions:

    // Implementation of IEventDispatcher
    //
    private var _bindingEventDispatcher:flash.events.EventDispatcher =.
    new flash.events.EventDispatcher (flash.events.IEventDispatcher (this));
    /**
    * @inheritDoc
    */
    public function addEventListener (type: String, listener: Function,)
    useCapture:Boolean = false,
    priority: int = 0,.
    weakRef:Boolean = false): void
    {
    _bindingEventDispatcher.addEventListener (type, listener, useCapture,
    priority, weakRef);
    }
    /**
    * @inheritDoc
    */
    public function dispatchEvent (event:flash.events.Event): Boolean
    {
    Return _bindingEventDispatcher.dispatchEvent (event);
    }
    /**
    * @inheritDoc
    */
    public void hasEventListener(type:String):Boolean
    {
    Return _bindingEventDispatcher.hasEventListener (type);
    }
    /**
    * @inheritDoc
    */
    public void removeEventListener (type: String,)
    Listener: Function,
    useCapture:Boolean = false): void
    {
    _bindingEventDispatcher.removeEventListener (type, listener, useCapture);
    }
    /**
    * @inheritDoc
    */
    public void willTrigger(type:String):Boolean
    {
    Return _bindingEventDispatcher.willTrigger (type);
    }
  • Can I add start and end dates to flex in WCS assets?

    Hi all

    I have to add the start and end dates to my flex belt and make it visible on the plus edition + inspect mode. For the Fund, it is STANDARD, but I have an obligation to do so for other assets that is not active promotion.

    Is there any doc/blog I can do? Help, please.

    Hi Avi.

    Dates of start and end standards are OOTB field in the metadata of the asset. So they you must set the cs.sitepreview property in the file futuretense.ini in the 'management '.

    CS.sitepreview = ContentManagement

    You can check out the documentation for more details about this property: futuretense.ini - 11 g Release 1 (11.1.1.8.0)

    If you need something different, maybe you need create your own attributes Start Date and end using types date: Data Design: active models - 11 g Release 1 (11.1.1.8.0)

    Kind regards

    Raul.

  • I'm looking for a tutorial I found a few days back on the display of tabular data in Flex

    Hello

    I picked up Flex programming a few days ago and I learned about the data grids and tabular display of data. I came across a tutorial with sample code that shows how 1. display information in a tabular format.

    2. how to read this information in an xml

    3. how to display more information if an element in the form of table are selected.

    the tutorial uses the players and their games favourite elements of tabular data, and once an item is selected, he showed the news editor of the game and detailed text information. I'm looking for this particular tutorial again and not able to find through google search

    Could you please help me find this article once again?

    Kind regards
    RAM

    Found.

    http://www.switchonthecode.com/tutorials/Flex-fun-Advanced-DataGrid-topics

  • HowTo 'Natural order' data (AS3/Flex)

    Hello

    I have a problem with my flex application. I am the analysis of data from certain Webservice and place it on an ArrayCollection collection.

    No such data are already in the 'natural order' on the server side. But somehow it s not like that in my ArrayCollection collection.

    I have found nothing canĀ“t howto things so 'natural order' within my Flex application or even with ActionScript 3 to all the...

    Thanks for the help!

    So if I understand correctly, while questions of kind is interesting and to solve, the real problem is that, at the time when the data are displayed in the comboBox control, is no longer in the order in which the data in when you browse the data to create the collection?

  • Transmission of data from Flex to JSP

    I have an advanceddatagrid with some data in it. When I double click on a line of the advanceddatagrid I want to pass the values of the selected row in the grid of a JSP page and display those values there.

    Could someone please guide me on how to do this?

    Thank you

    You can do this either by assigning values to an ArrayCollection or XML RemoteObject, HTTPservice respectively collection to send data.

    If you want to use typed objects use the remote object method.

    Look for these docs DataAcess Flex ways.

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=data_intro_2.html

    If this post answers your question mark it as such.

    See you soon,.

    PRAD.

  • Manipulation of PDF in Flex

    Hello

    is it possible to manipulate PDFs in Flex 3?

    What I want to do is

    • load (not necessarily view) a PDF file existing in a Flex, AIR, AS3 environment
    • read its properties, such as the PDF version and finally
    • make changes to the PDF file, for example to convert the PDF/A for archiving, i.e. Acrobat Standard or professional capabilities.

    I know that AlivePDF is THE library when it comes to PDF generation, but is there something similar for PDF manipulation? Or kit Acrobat SDK will be available for Flex programmers to AIR, as in the near future?

    Thanks in advance!

    Thilo

    If I'm not wrong that acrobat has a javascript API that you can use, but it will require that the user have the pro version to do this, I don't think that Adobe will make this a free utility because it is a software that generates a good income for Adobe.

  • link broken on data technologies\flex services

    Break the link to the presentation of flex data services overview
    ( http://macromedia.breezecentral.com/fes ) is broken on the page
    http://labs.Macromedia.com/technologies/flexdata_services2/ . on the get started tab, step 1, point 3 of the ball

    It seems to work for me, maybe, it has been fixed since your post.

  • SQLAssembler: Manipulation of dates

    I wonder if anyone has had some luck using date/time with SQLAssembler fields, I have a few problems.

    My update query statement looks like this:

    Update < element >

    < sql > update the VALUE of timesheet nobody = nobody # #, < sniiiiip, many fields >, date = #date # WHERE id = #_PREV.id # < / sql >

    < / item update >


    I'm editing data in the DataService with an editor of the article, which looks like this:

    < mx:itemEditor >

    < mx:Component > < mx:DateField formatString = "DD/MM/YYYY" / > < / mx:Component >

    < / mx:itemEditor >

    I use an actionscript class declaration in the config of SQLAssembler; this class, var, called 'date' is of type Date.

    My database is an Access MDB connection with sun.jdbc.odbc.JdbcOdbcDriver.

    If I remove the part that defines the date field (date = #date #) of my update query, everything works perfectly.

    I set to show all messages in debug, and it comes to the specified error when I leave the date field after changing of LCDS:

    When I put editorDataField = "selectedDate", I get the following error:

    [Flex] 16:19:50.468 [DEBUG] [Service.Data.SQL] exception jdbc SQL assembler on the operation = update-point error = java.sql.SQLException: SQL Exception: Unknown Type SQL for PreparedStatement.setObject (Type SQL = 1111

    And if I put editorDataField = 'text' (which seems to cause the format string to apply according to the Protocol rtmp message interceptions), then I get this:

    [Flex] 16:27:23.500 [DEBUG] [Service.Data.SQL] exception jdbc SQL assembler on the operation = update-point error = java.sql.SQLException: syntax [Microsoft] [ODBC Microsoft Access driver] error in the UPDATE statement.

    And if I add single quotes around the date field in the update query (date =' #date #'), I get this:

    [Flex] 16:32:11.156 [DEBUG] [Service.Data.SQL] exception jdbc SQL assembler on the operation = update-point error = java.sql.SQLException: unexpected exception: 7

    I tried various format strings, which I think should manage access, but they are all causing the unexpected exception error. I also tried to change the data type on the actionscript string class, but it still gives the same results.

    What would be really handy would be if I could see the exact query that is executed on the database to try to determine what is actually entered when the error occurs.

    I tried this driver jdbc logging, but so far I couldn't make it work with the Access driver and troubleshooting documentation is very sparse.

    If anyone has any clues on how I can see the query to update real sqlassembler is running or what I need to do to activate the editable fields date I would be very grateful.

    Thank you

    Robert

    I have now tried with 2 other databases:

    MySQL works perfectly.

    MSSQL fails with the error "the Java type java.util.Date is not a supported type."

    So, this might be a question about whether a specific JDBC driver can map Java date to a field properly object.

    EDIT:

    I tried to experiment another JDBC driver to connect to MSSQL: jTDS

    It failed with a very similar error message, but it can be tweaked to map the type JAVA_OBJECT to datetime, but there may be side effects of the change (for example another type without mapping available defined my cause now an exception of class go up rather than leading to an sql exception arises).

    In most situations storing date into a timestamp would be more appropriate than a datetime field, but as the SQLAssembler seems to be impossible to map the stamp everything except ByteArray this solution doesn't seem possible here. If SQLAssembler was mapped to java. sql. Date instead of java. util. Date, this would be as undesirable as the java.sql version does not include the time.

    If anyone is interested in the settings so that to do the jTDS driver then post them here and I'll put up the diff, but really he feels "a bit dodgy" to map the fields JAVA_OBJECT jdbc to this day and probably not something you want to do in production for the sake of reliability (it's just for a small internal project at my company).

    Now, I just need to work how best to allow people to edit a time and date in the DateField...

  • How to assimilate two Dates in flex

    Hello
    I need to compare two dates, the < and > works pretty but == show no results, even if two dates are equal. Now I'm equating taking date, month, year, hour, time of two dates. Y at - there no direct way two find if two dates are equal or not.

    Date are usually stored more than a millisecond to a point of reference, in flex, this reference is midnight Jan 1, 1970. There are two ways to get this number: property at the time when the valueOf() method. Then

    var d1:Date =...
    var d2:Date =...

    If (d1.time == d2.time) or if (d1.valueOf () == d2.valueOf ())...

    ATTA

  • Manipulation of data series

    I don't know how to handle the serial data I receive from a touch panel.

    What I want to do is view the two sets of coordinates, which are made up of two 4-digit.

    What I am struggling with, is the return of cart/line feed (Cr/Lf).

    For example, I get,

    TP TP CrLf = hurry touchscreen

    CrLf 0100 0100 = first game X coordinates where these values can be anything from 0000 to 4,000 and as wise as all coordinates

    0200 0200 first = CrLf series Y coordinates

    TR CrLf TR = touchscreen released

    CrLf 0100 0100 = last set of coordinates X

    0200 0200 CrLf = last set of coordinates Y

    If you drag the stylus on the touch screen, then I may receive many TP CrLf more details before final output all touchscreen.

    If I had all the CrLf but just a CrLf "after TP nnnn nnnn it wouldn't be problem.

    I had a discount using shift registers, but I'm not sure of the best way to go.

    Some advice would be most appreciated.

    Something like that?

  • Manipulation of data DVR - is that correct?

    Hello

    I'm new to DVR, but trying to integrate them into my current project. My data are in a cluster, and some things I want to change, while others, I want to just use in a calculation or a setting. For items that I don't want change, can I just ungroup them before the in-place-element (REI) where I change what needs to change? Or this will create a copy of the entire cluster of data?

    Also, about the antiderivative of exchange values, I use that correctly? I realized that if Exchange you the old value with the new value, then it will be able to put the new value in a memory space of the old value.

    Thanks for the pointers you can give me on this topic!

    gregoryj wrote:

    Right now I'm passing around my data using a FGV. At the end of a test, the data have some great paintings, the size of one can be about 2000 x 20, and I thought it would be more efficient to use digital recorders.

    You run into a problem, or you think that the DVR will be "more effective"? A large table takes up the same amount of space whether or not it is encapsulated in a DVR. A DVR serializes access to this table, as does a FGV or a single item queue, and made a normal thread as long as your subVIs that alter this table always pass the entrance through the exit.

    gregoryj wrote:

    I'm not too familiar with the Swap Values function. Should not be used when the data is stored is not unbundle node?

    In this case it worsens your code, unless the compiler optimizes out. The multiplication operation works normally in place on top of entry, if he can. However, with values of your Swap, the code now has a copy of the unedited value, as well, so he can exchange - you forced a copy where none was previously necessary. See the screenshot below showing buffer allocations. The version with the swap requires 4 allowances of buffer, the version without works with only 3. Does not clutter your code with unnecessary functions that you do not really understand.

  • Manipulation of data from a cursor ref in the block of data in a form

    I use Oracle Forms 10 g. I have a ref cursor that returns the columns A, B, C, D, E, B, C, D, E are where values. The attribute"query data Source name"in the datablock contains "CCTR_Extract_pkg.cctr_refcur". The attribute 'Column name' article A contains 'A', point B contains 'B', etc. All of these columns are displayed on the form, and everything works perfectly.

    I have a new request, users would like a 6th displayed column - F - where it is equal to D - B.

    Is it possible to do so in the form only, or do I have to change the ref cursor to accommodate the new column, and then the form?
    If it is possible in the form (only) - how to reference the 2 columns?

    Thank you in anticipation
    Michael

    Published by: user8897365 on August 24, 2011 10:32

    My understanding of the ref Cursor, if you change it and then all other objects that use it also require recompilation. I was trying to avoid this situation.

    Since your block of form data is based on the Ref Cursor, you cannot avoid this. You must change the Ref Cursor to add the required columns.

    I was hoping that there may be a way to reference the elements of ref cursor in a similar way (IE not change ref cursor).

    Depending on how the new columns are data in your Ref Cursor, you could add the columns as part of another base table and then use the trigger after query to retrieve the associated data. Unfortunately, this make the data in these new column cannot be changed. If you do not need the ability to update data, it is an option.

    Craig...

Maybe you are looking for