TeleFlow Forums
http://teleflow.org/phpbb/

Say dates in different formats
http://teleflow.org/phpbb/viewtopic.php?f=7&t=490
Page 1 of 1

Author:  Mtdll [ Tue Jan 08, 2008 5:11 am ]
Post subject:  Say dates in different formats

Hi!
Currently Teleflow can say dates (e.g. stored on a database) that are in the format yyyy/mm/dd or yyyy/mm or mm/dd.
Problem is that that format is the north-american/british way to write dates. In other places of the world we use dd/mm/yyyy.
We can work with this by taking out all 3 components of a date, using one variable for days, one for months and one for years and joining them together later in the format that teleflow will read. This works but it'd be nice to see the ability to read dates in other formats (it shouldn't be difficult either).
Is it possible?

Thanks!

Author:  Chris [ Thu Jan 10, 2008 10:48 am ]
Post subject: 

This currently isn't possible in TeleFlow, without doing the work of splitting your existing date variable up, as you mentioned.

I would recommend creating a flowchart for this purpose, which you can use every time you need to perform such a conversion. You could pass your existing date in as parameter 1, pass by reference, and return the date variable converted to TeleFlow format. (after you chop it into year, month, day and put it back together in YYYY/MM/DD)

YYYY/MM/DD is actually not the north american way of handling dates, but it is TeleFlow's. This was done because it is sortable in character format, which can be highly advantageous for database work. (It is also great for readability, because it goes from least to most precise, rather than middle/most/least, as per the typical north american date format, of mm/dd/yyyy)

TeleFlow doesn't have strict data-types, and in fact, everything in TeleFlow is essentially treated as a string (and can be manipulated as such). There is context-data-typing, which means that depending on what you are doing at the time, TeleFlow will treat the variable appropriately. This makes simply adding additional formats for specific data types (which don't REALLY exist in TeleFlow) more work than it would otherwise be.

That said, it is also one of the powerful features of TeleFlow, allowing you to append numbers to a string of numbers, or add to it. You can chop up your date string into year, month, and day, or you can subtract or add days from or to it (without having to run any special functions - such as converting a date to a string, or vice versa - to do these things).

Having said that, we are always looking at new ways of making working with TeleFlow easier, and thank you for the suggestion. While we are unlikely to add additional formats for the date "data type", we will note this issue and see what might be done to help make things easier in the future.

Thank you!

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/