[swift-corelibs-dev] NSDate, NSDateFormatter
joe at iachieved.it
Fri Dec 11 12:53:52 CST 2015
Thanks Tony, with LD_LIBRARY_PATH set to include usr/lib/swift/linux I can
get the REPL to reproduce what I see with the compiler, and that's a blank
line printed out:
Which leads me to the obvious question, either I've forgotten how to use
NSDateFormatter, or the implementation in the December 1 drop is silently
not supporting setting the dateFormat property, which appears to be the
case, as setting dateStyle and timeStyle do appear to work.
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "dd-MM-yyyy"
var dateStr = dateFormatter.stringFromDate(NSDate())
dateFormatter.dateStyle = .MediumStyle
dateFormatter.timeStyle = .MediumStyle
dateStr = dateFormatter.stringFromDate(NSDate())
<-- this is a blank line emitted by the first print(), which it should not
Dec 11, 2015, 6:52:33 PM
Thanks for any insight and if I need to file a bug report I am happy to
On Fri, Dec 11, 2015 at 10:59 AM, Tony Parker <anthony.parker at apple.com>
> Hi Joe,
> Try this as a workaround: Set the LD_LIBRARY_PATH environment variable to
> This should only affect the REPL and not compiled code.
> I think this is supposed to be fixed in the top of tree Swift but not in
> the Dec 1 binary drop.
> - Tony
> On Dec 11, 2015, at 5:54 AM, Joseph Bell via swift-corelibs-dev <
> swift-corelibs-dev at swift.org> wrote:
> Howdy. I am using swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04 that was
> released on December 1. The following code:
> import Foundation
> let dateFormatter = NSDateFormatter()
> dateFormatter.dateFormat = "dd-MM-yyyy"
> let dateStr = dateFormatter.stringFromDate(NSDate())
> results in
> LLVM ERROR: Program used external function
> '_TFC10Foundation6NSDateCfT_S0_' which could not be resolved!
> when executed with the swift driver, and then when compiled with swiftc
> the print statement just gives a blank newline.
> I don't know if this is a known issue (I haven't found any reference on
> the status page or elsewhere indicating this was unimplemented), or I have
> an environmental problem.
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-corelibs-dev