将LocalDate转换为LocalDateTime或java.sql.Timestamp(Convert LocalDate to LocalDateTime or java.sql.Timestamp)
我正在使用JodaTime 1.6.2。
我有一个
LocalDate
,我需要转换为(Joda)LocalDateTime
或用于ormapping的java.sqlTimestamp
。原因是我已经弄清楚如何在
LocalDateTime
和java.sql.Timestamp
之间进行转换:LocalDateTime ldt = new LocalDateTime(); DateTimeFormatter dtf = DateTimeFormatter.forPattern("yyyy-MM-dd HH:mm:ss"); Timestamp ts = Timestamp.valueOf(ldt.toString(dtf));
所以,如果我可以在
LocalDate
和LocalDateTime
之间转换,那么我可以继续转换到java.sql.Timestamp
。 感谢任何推动在正确的方向!I am using JodaTime 1.6.2.
I have a
LocalDate
that I need to convert to either a (Joda)LocalDateTime
, or ajava.sqlTimestamp
for ormapping.The reason for this is I have figured out how to convert between a
LocalDateTime
and ajava.sql.Timestamp
:LocalDateTime ldt = new LocalDateTime(); DateTimeFormatter dtf = DateTimeFormatter.forPattern("yyyy-MM-dd HH:mm:ss"); Timestamp ts = Timestamp.valueOf(ldt.toString(dtf));
So, if I can just convert between
LocalDate
andLocalDateTime
, then I can make the continued conversion tojava.sql.Timestamp
. Thanks for any nudges in the right direction!
原文:https://stackoverflow.com/questions/8992282
最满意答案
我将它安装在
$(pkglibexecdir)
:pkglibexec_PROGRAMS = ampl-student # If you need to know the path in your code AM_CPPFLAGS = -DPKGLIBEXECDIR=\"$(pkglibexecdir)\"
这不是一个真正的用户程序,所以这安装在某个地方。 默认情况下,这将是
$(prefix)/libexec/$(package)
。I'd install it in
$(pkglibexecdir)
:pkglibexec_PROGRAMS = ampl-student # If you need to know the path in your code AM_CPPFLAGS = -DPKGLIBEXECDIR=\"$(pkglibexecdir)\"
It's not really a user program, so this installs it somewhere out of the way. By default, this is going to be
$(prefix)/libexec/$(package)
.
相关问答
更多-
如何在Automake和libtool-using项目中构建* .so模块?(How to build *.so module in Automake and a libtool-using project?)[2022-10-02]
你要找的是一个所谓的“ 模块 ”。 并且您可以通过将-all-static添加到应用程序的LDFLAGS来指示autotools创建静态二进制文件(可执行文件)。 我认为这是使用--disable-shared配置标志的首选方式(它确实针对的是库而不是可执行文件) 像这样的事情应该可以做到这一点: AM_CPPFLAGS=-I$(top_srcdir)/include lib_LTLIBRARIES=module.la module_la_LDFLAGS=-module -avoid-version -s ... -
我将它安装在$(pkglibexecdir) : pkglibexec_PROGRAMS = ampl-student # If you need to know the path in your code AM_CPPFLAGS = -DPKGLIBEXECDIR=\"$(pkglibexecdir)\" 这不是一个真正的用户程序,所以这安装在某个地方。 默认情况下,这将是$(prefix)/libexec/$(package) 。 I'd install it in $(pkglibexecdir) ...
-
解决方案与brew无法将二进制文件链接到PATH 。 取消链接和重新链接解决了它。 The solution had to do with brew having failed to link the binary into the PATH. Un-linking and re-linking solved it.
-
您可以构建一个便利库,并将其静态链接到您的应用程序。 这与目标文件之间的差异最终很小。 请参阅Automake手册的此页面 。 基本上它是这样的: noinst_LIBRARIES = libdriver.a libdriver_a_SOURCES = @CORRECT_IMPLEMENTATION_FILE@ myprogram_LDADD = libdriver.a 你的具有固定名称的中间对象文件是libdriver.a ,你的应用程序是myprogram 。 然而,这似乎对我来说不必要的复杂。 我没 ...
-
我应该使用librealsense-platform.jar $ javac -cp javacpp-presets-bin/javacpp.jar:javacpp-presets-bin/librealsense-platform.jar TestConnection.java $ java -jar javacpp-presets-bin/javacpp.jar TestConnection $ java -cp javacpp-presets-bin/javacpp.jar:javacpp-prese ...
-
使用automake进行交叉编译(Cross compiling with automake)[2021-09-30]
根据您的情况,您应该使用DESTDIR 。 设置--prefix意味着生成的程序将安装在--prefix中的位置。 另一方面, DESTDIR是一个纯粹的make install工件,它在安装时只是前缀到每个路径的开头。 生成的产品仍然希望安装在--prefix位置。 如果要在目标主机上安装结果,请将--prefix设置为它将去的位置,并使用DESTDIR将其分配到其他位置。 我相信只是在configure脚本中设置--sysroot是不够的,但我不确定。 我认为在configure运行时设置sysroot ... -
有关如何解决问题的任何想法? 你不能用当前的automake实现来做到这一点。 这是一个功能 。 Any ideas about how to solve the issue? You can't do that with the current implementation of automake. This is a feature.
-
automake输出比命令行编译的bin更大的二进制文件(automake output binaries bigger than the command-line compiled bins)[2022-03-27]
只需在安装二进制文件时调用make install-strip , install将在安装过程中删除它们。 Just invoke make install-strip when you install the binaries and install will strip them during the install process. -
你可以使用echo $(foo)打印变量值, foo = some_file.c another_file.c all: echo $(foo)) You can use echo $(foo) to print the variable value, foo = some_file.c another_file.c all: echo $(foo))
-
在Solaris上是否有针对Node.JS的预构建二进制文件?(Are there any pre-built binaries for Node.JS on Solaris?)[2021-10-11]
http://www.petertribble.co.uk/Solaris/node.html http://groups.google.com/group/nodejs/t/47680586592637f2 http://www.petertribble.co.uk/Solaris/node.html http://groups.google.com/group/nodejs/t/47680586592637f2